summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrisztian Pinter <pin.terminator@gmail.com>2014-07-28 19:18:14 +0200
committerKrisztian Pinter <pin.terminator@gmail.com>2014-07-28 19:18:14 +0200
commitccea0834d79545369af70a7240e3480e183a6102 (patch)
treefef62884d9aa087a5697c4a97ce69c8786a44c6c
parent1c5adcc87fd183282296f4f4ea84f3584525f228 (diff)
Change palette selection ComboBox to ListBox
Change-Id: Id844781c06e37d66f3eebac9d905c58a62682cb0
-rw-r--r--svx/source/tbxctrls/colorwindow.hxx4
-rw-r--r--svx/source/tbxctrls/tbcontrl.cxx19
-rw-r--r--svx/uiconfig/ui/colorwindow.ui23
3 files changed, 24 insertions, 22 deletions
diff --git a/svx/source/tbxctrls/colorwindow.hxx b/svx/source/tbxctrls/colorwindow.hxx
index 2f2d3183e2d9..70db254f9de2 100644
--- a/svx/source/tbxctrls/colorwindow.hxx
+++ b/svx/source/tbxctrls/colorwindow.hxx
@@ -30,7 +30,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 --------------------------------------------------
@@ -44,7 +44,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 591c51a51aee..057494819ee0 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1032,7 +1032,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");
@@ -1068,15 +1068,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 ) );
@@ -1088,7 +1088,7 @@ SvxColorWindow_Impl::SvxColorWindow_Impl( const OUString& rCommand,
AddStatusListener( maCommand );
mrPaletteManager.ReloadColorSet(*mpColorSet);
- mpPaletteComboBox->Show();
+ mpPaletteListBox->Show();
mpButtonPicker->Show();
mpColorSet->Show();
}
@@ -1146,11 +1146,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;
}
@@ -1162,7 +1160,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>