diff options
author | Krisztian Pinter <pin.terminator@gmail.com> | 2014-07-28 19:18:14 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2014-09-17 10:19:51 +0200 |
commit | ec4a78420e4a6ea9e3ded6c14ff8143e96f159d6 (patch) | |
tree | 8c35e1a10057b10f0d8a5854b270eb246daba225 /svx | |
parent | d5109b2fcf1ed7880e7e68c70daaa2f05b0b3cea (diff) |
Change palette selection ComboBox to ListBox
Change-Id: Id844781c06e37d66f3eebac9d905c58a62682cb0
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/tbxctrls/colorwindow.hxx | 4 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 19 | ||||
-rw-r--r-- | svx/uiconfig/ui/colorwindow.ui | 23 |
3 files changed, 24 insertions, 22 deletions
diff --git a/svx/source/tbxctrls/colorwindow.hxx b/svx/source/tbxctrls/colorwindow.hxx index df574d87993b..68829dcb227f 100644 --- a/svx/source/tbxctrls/colorwindow.hxx +++ b/svx/source/tbxctrls/colorwindow.hxx @@ -27,7 +27,7 @@ #include <com/sun/star/frame/XFrame.hpp> #include <svx/SvxColorValueSet.hxx> #include <svx/PaletteManager.hxx> -#include <vcl/combobox.hxx> +#include <vcl/lstbox.hxx> class SvxColorWindow_Impl : public SfxPopupWindow { @@ -37,7 +37,7 @@ private: const sal_uInt16 theSlotId; SvxColorValueSet* mpColorSet; Size maWindowSize; - ComboBox* mpPaletteComboBox; + ListBox* mpPaletteListBox; PushButton* mpButtonPicker; OUString maCommand; Link maSelectedLink; diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 5177544e91fb..f55fc294cb90 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -1016,7 +1016,7 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand, mrPaletteManager( rPaletteManager ) { - get(mpPaletteComboBox, "palette_list_combobox"); + get(mpPaletteListBox, "palette_listbox"); get(mpButtonPicker, "color_picker_button"); get(mpColorSet, "colorset"); @@ -1052,15 +1052,15 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand, mpColorSet->SetAccessibleName( SVX_RESSTR( RID_SVXSTR_LINECOLOR ) ); } - mpPaletteComboBox->SetStyle( mpPaletteComboBox->GetStyle() | WB_BORDER | WB_AUTOSIZE ); - mpPaletteComboBox->SetSelectHdl( LINK( this, SvxColorWindow_Impl, SelectPaletteHdl ) ); - mpPaletteComboBox->AdaptDropDownLineCountToMaximum(); + mpPaletteListBox->SetStyle( mpPaletteListBox->GetStyle() | WB_BORDER | WB_AUTOSIZE ); + mpPaletteListBox->SetSelectHdl( LINK( this, SvxColorWindow_Impl, SelectPaletteHdl ) ); + mpPaletteListBox->AdaptDropDownLineCountToMaximum(); std::vector<OUString> aPaletteList = mrPaletteManager.GetPaletteList(); - mpPaletteComboBox->SetText( aPaletteList[ mrPaletteManager.GetPalette() ] ); for( std::vector<OUString>::iterator it = aPaletteList.begin(); it != aPaletteList.end(); ++it ) { - mpPaletteComboBox->InsertEntry( *it ); + mpPaletteListBox->InsertEntry( *it ); } + mpPaletteListBox->SelectEntryPos(mrPaletteManager.GetPalette(), true); mpButtonPicker->SetClickHdl( LINK( this, SvxColorWindow_Impl, OpenPickerClickHdl ) ); @@ -1072,7 +1072,7 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand, AddStatusListener( maCommand ); mrPaletteManager.ReloadColorSet(*mpColorSet); - mpPaletteComboBox->Show(); + mpPaletteListBox->Show(); mpButtonPicker->Show(); mpColorSet->Show(); } @@ -1130,11 +1130,9 @@ IMPL_LINK_NOARG(SvxColorWindow_Impl, SelectHdl) IMPL_LINK_NOARG(SvxColorWindow_Impl, SelectPaletteHdl) { - OUString sSrchTxt = mpPaletteComboBox->GetText(); - sal_Int32 nPos = mpPaletteComboBox->GetEntryPos( sSrchTxt ); + sal_Int32 nPos = mpPaletteListBox->GetSelectEntryPos(); mrPaletteManager.SetPalette( nPos ); mrPaletteManager.ReloadColorSet(*mpColorSet); - Resize(); return 0; } @@ -1146,7 +1144,6 @@ IMPL_LINK_NOARG(SvxColorWindow_Impl, OpenPickerClickHdl) void SvxColorWindow_Impl::Resize() { - mpColorSet->layoutAllVisible(mrPaletteManager.GetColorCount()); SetOutputSizePixel(maWindowSize); } diff --git a/svx/uiconfig/ui/colorwindow.ui b/svx/uiconfig/ui/colorwindow.ui index 54b8f49ca057..0527e78c7294 100644 --- a/svx/uiconfig/ui/colorwindow.ui +++ b/svx/uiconfig/ui/colorwindow.ui @@ -14,15 +14,9 @@ <property name="visible">True</property> <property name="can_focus">False</property> <child> - <object class="GtkComboBox" id="palette_list_combobox"> + <object class="GtkComboBox" id="palette_listbox"> <property name="visible">True</property> <property name="can_focus">False</property> - <property name="has_entry">True</property> - <child internal-child="entry"> - <object class="GtkEntry" id="combobox-entry"> - <property name="can_focus">False</property> - </object> - </child> </object> <packing> <property name="expand">True</property> @@ -32,14 +26,14 @@ </child> <child> <object class="GtkButton" id="color_picker_button"> - <property name="label">Palette</property> + <property name="label">Color picker</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> </object> <packing> <property name="expand">False</property> - <property name="fill">True</property> + <property name="fill">False</property> <property name="position">1</property> </packing> </child> @@ -62,6 +56,17 @@ <property name="position">1</property> </packing> </child> + <child> + <object class="GtkSeparator" id="separator1"> + <property name="visible">True</property> + <property name="can_focus">False</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">2</property> + </packing> + </child> </object> </child> </object> |