diff options
author | Krisztian Pinter <pin.terminator@gmail.com> | 2014-07-08 19:08:38 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2014-09-17 10:19:37 +0200 |
commit | ff17738a4a84ca53782d87da5f63d87a165d19d1 (patch) | |
tree | dff794a8637879ce047bdfe3f23951b6ef5e6559 /svx/source/tbxctrls/PaletteManager.cxx | |
parent | 9ab1a4a0306c81c282225f1ddcb5a1c4678e9311 (diff) |
Add color picker to color palette
Change-Id: I651f485598ee57af815780e234031f101b63fa24
Diffstat (limited to 'svx/source/tbxctrls/PaletteManager.cxx')
-rw-r--r-- | svx/source/tbxctrls/PaletteManager.cxx | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx index 88916ee85fc7..e9933d4eff96 100644 --- a/svx/source/tbxctrls/PaletteManager.cxx +++ b/svx/source/tbxctrls/PaletteManager.cxx @@ -23,11 +23,13 @@ #include <sfx2/objsh.hxx> #include "svx/drawitem.hxx" #include <svx/dialogs.hrc> +#include <svtools/colrdlg.hxx> PaletteManager::PaletteManager() : mnNumOfPalettes(2), mnCurrentPalette(0), - mnColorCount(0) + mnColorCount(0), + mLastColor(COL_AUTO) { LoadPalettes(); mnNumOfPalettes += maPalettes.size(); @@ -127,4 +129,31 @@ OUString PaletteManager::GetPaletteName() return OStringToOUString(maPalettes[mnCurrentPalette - 1].GetPaletteName(), RTL_TEXTENCODING_ASCII_US); } +const Color& PaletteManager::GetLastColor() +{ + return mLastColor; +} + +void PaletteManager::SetLastColor(const Color& rLastColor) +{ + mLastColor = rLastColor; +} + +void PaletteManager::SetBtnUpdater(svx::ToolboxButtonColorUpdater* pBtnUpdater) +{ + mpBtnUpdater = pBtnUpdater; +} + +void PaletteManager::PopupColorPicker() +{ + SvColorDialog aColorDlg( 0 ); + aColorDlg.SetColor ( mLastColor ); + aColorDlg.SetMode( svtools::ColorPickerMode_MODIFY ); + if( aColorDlg.Execute() == RET_OK ) + { + mpBtnUpdater->Update( aColorDlg.GetColor() ); + mLastColor = aColorDlg.GetColor(); + } +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |