diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2016-06-16 12:33:39 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-07-01 13:31:46 +0000 |
commit | 4760c44c80e6dece5fe1a2e170b0f69c500a9681 (patch) | |
tree | a32b987b0a8821498dc00d3ee92eb0908270fbf1 /cui | |
parent | 663b7aec30703c8479c9dec2f8955bdc28bdca5e (diff) |
GSoC possibility to change icon size in the SidebarToolBox
+ Added registy entry to store icon size
+ Added UI to change settings: Tools -> Options... -> View
+ Loading last settings in the SidebarToolBox
+ Settings update listener
Update icon code from: framework/source/uielement/toolbarmanager.cxx
Change-Id: I1d713c50fccfc19e1c8ea82eba68556ddb76cd3c
Reviewed-on: https://gerrit.libreoffice.org/26362
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optgdlg.cxx | 23 | ||||
-rw-r--r-- | cui/source/options/optgdlg.hxx | 2 | ||||
-rw-r--r-- | cui/uiconfig/ui/optviewpage.ui | 39 |
3 files changed, 59 insertions, 5 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index c8b07afff987..bba62a3cf18f 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -612,6 +612,7 @@ void CanvasSettings::EnabledHardwareAcceleration( bool _bEnabled ) const OfaViewTabPage::OfaViewTabPage(vcl::Window* pParent, const SfxItemSet& rSet) : SfxTabPage(pParent, "OptViewPage", "cui/ui/optviewpage.ui", &rSet) , nSizeLB_InitialSelection(0) + , nSidebarSizeLB_InitialSelection(0) , nStyleLB_InitialSelection(0) , pAppearanceCfg(new SvtTabAppearanceCfg) , pCanvasSettings(new CanvasSettings) @@ -620,6 +621,7 @@ OfaViewTabPage::OfaViewTabPage(vcl::Window* pParent, const SfxItemSet& rSet) { get(m_pWindowSizeMF, "windowsize"); get(m_pIconSizeLB, "iconsize"); + get(m_pSidebarIconSizeLB, "sidebariconsize"); get(m_pIconStyleLB, "iconstyle"); get(m_pFontAntiAliasing, "aafont"); @@ -701,6 +703,7 @@ void OfaViewTabPage::dispose() pAppearanceCfg = nullptr; m_pWindowSizeMF.clear(); m_pIconSizeLB.clear(); + m_pSidebarIconSizeLB.clear(); m_pIconStyleLB.clear(); m_pFontAntiAliasing.clear(); m_pAAPointLimitLabel.clear(); @@ -759,6 +762,22 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* ) aMiscOptions.SetSymbolsSize( eSet ); } + const sal_Int32 nSidebarSizeLB_NewSelection = m_pSidebarIconSizeLB->GetSelectEntryPos(); + if( nSidebarSizeLB_InitialSelection != nSidebarSizeLB_NewSelection ) + { + // from now on it's modified, even if via auto setting the same size was set as now selected in the LB + sal_Int16 eSet = TOOLBOX_BUTTONSIZE_DONTCARE; + switch( nSidebarSizeLB_NewSelection ) + { + case 0: eSet = TOOLBOX_BUTTONSIZE_DONTCARE; break; + case 1: eSet = TOOLBOX_BUTTONSIZE_SMALL; break; + case 2: eSet = TOOLBOX_BUTTONSIZE_LARGE; break; + default: + OSL_FAIL( "OfaViewTabPage::FillItemSet(): This state of m_pSidebarIconSizeLB should not be possible!" ); + } + aMiscOptions.SetSidebarIconSize( eSet ); + } + const sal_Int32 nStyleLB_NewSelection = m_pIconStyleLB->GetSelectEntryPos(); if( nStyleLB_InitialSelection != nStyleLB_NewSelection ) { @@ -904,6 +923,10 @@ void OfaViewTabPage::Reset( const SfxItemSet* ) nSizeLB_InitialSelection = ( aMiscOptions.AreCurrentSymbolsLarge() )? 2 : 1; m_pIconSizeLB->SelectEntryPos( nSizeLB_InitialSelection ); m_pIconSizeLB->SaveValue(); + if( aMiscOptions.GetSidebarIconSize() != TOOLBOX_BUTTONSIZE_DONTCARE ) + nSidebarSizeLB_InitialSelection = aMiscOptions.GetSidebarIconSize(); + m_pSidebarIconSizeLB->SelectEntryPos( nSidebarSizeLB_InitialSelection ); + m_pSidebarIconSizeLB->SaveValue(); if (aMiscOptions.IconThemeWasSetAutomatically()) { nStyleLB_InitialSelection = 0; diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx index e6d99e67ad67..60df261b5de9 100644 --- a/cui/source/options/optgdlg.hxx +++ b/cui/source/options/optgdlg.hxx @@ -81,6 +81,7 @@ class OfaViewTabPage : public SfxTabPage private: VclPtr<MetricField> m_pWindowSizeMF; VclPtr<ListBox> m_pIconSizeLB; + VclPtr<ListBox> m_pSidebarIconSizeLB; VclPtr<ListBox> m_pIconStyleLB; VclPtr<CheckBox> m_pFontAntiAliasing; @@ -103,6 +104,7 @@ private: VclPtr<ListBox> m_pMouseMiddleLB; sal_Int32 nSizeLB_InitialSelection; + sal_Int32 nSidebarSizeLB_InitialSelection; sal_Int32 nStyleLB_InitialSelection; SvtTabAppearanceCfg* pAppearanceCfg; diff --git a/cui/uiconfig/ui/optviewpage.ui b/cui/uiconfig/ui/optviewpage.ui index c6b899af4d81..5b9e03ccbb39 100644 --- a/cui/uiconfig/ui/optviewpage.ui +++ b/cui/uiconfig/ui/optviewpage.ui @@ -367,7 +367,7 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">2</property> + <property name="top_attach">3</property> </packing> </child> <child> @@ -396,7 +396,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">2</property> + <property name="top_attach">3</property> </packing> </child> <child> @@ -411,7 +411,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">3</property> + <property name="top_attach">4</property> <property name="width">2</property> </packing> </child> @@ -426,7 +426,7 @@ </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">4</property> + <property name="top_attach">5</property> </packing> </child> <child> @@ -439,7 +439,36 @@ </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">4</property> + <property name="top_attach">5</property> + </packing> + </child> + <child> + <object class="GtkLabel" id="label9"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="halign">end</property> + <property name="label" translatable="yes">Sidebar _icon size:</property> + <property name="use_underline">True</property> + <property name="mnemonic_widget">iconsize</property> + </object> + <packing> + <property name="left_attach">0</property> + <property name="top_attach">2</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="sidebariconsize"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <items> + <item translatable="yes">Automatic</item> + <item translatable="yes">Small</item> + <item translatable="yes">Large</item> + </items> + </object> + <packing> + <property name="left_attach">1</property> + <property name="top_attach">2</property> </packing> </child> </object> |