Kaydet (Commit) ec4a7842 authored tarafından Krisztian Pinter's avatar Krisztian Pinter Kaydeden (comit) Tomaž Vajngerl

Change palette selection ComboBox to ListBox

Change-Id: Id844781c06e37d66f3eebac9d905c58a62682cb0
üst d5109b2f
......@@ -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;
......
......@@ -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);
}
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment