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 /svtools | |
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 'svtools')
-rw-r--r-- | svtools/source/config/miscopt.cxx | 55 |
1 files changed, 54 insertions, 1 deletions
diff --git a/svtools/source/config/miscopt.cxx b/svtools/source/config/miscopt.cxx index 2d30403096a3..67939398b89c 100644 --- a/svtools/source/config/miscopt.cxx +++ b/svtools/source/config/miscopt.cxx @@ -62,6 +62,8 @@ using namespace ::com::sun::star; #define PROPERTYHANDLE_EXPERIMENTALMODE 8 #define PROPERTYNAME_MACRORECORDERMODE "MacroRecorderMode" #define PROPERTYHANDLE_MACRORECORDERMODE 9 +#define PROPERTYNAME_SIDEBARICONSIZE "SidebarIconSize" +#define PROPERTYHANDLE_SIDEBARICONSIZE 10 #define VCL_TOOLBOX_STYLE_FLAT ((sal_uInt16)0x0004) // from <vcl/toolbox.hxx> @@ -75,6 +77,8 @@ private: bool m_bIsPluginsEnabledRO; sal_Int16 m_nSymbolsSize; bool m_bIsSymbolsSizeRO; + sal_Int16 m_nSidebarIconSize; + bool m_bIsSidebarIconSizeRO; bool m_bIsSymbolsStyleRO; sal_Int16 m_nToolboxStyle; bool m_bIsToolboxStyleRO; @@ -146,8 +150,13 @@ public: inline sal_Int16 GetSymbolsSize() { return m_nSymbolsSize; } + inline sal_Int16 GetSidebarIconSize() + { return m_nSidebarIconSize; } + void SetSymbolsSize( sal_Int16 nSet ); + void SetSidebarIconSize( sal_Int16 nSet ); + static OUString GetIconTheme(); enum SetModifiedFlag { SET_MODIFIED, DONT_SET_MODIFIED }; @@ -225,6 +234,8 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl() , m_bIsPluginsEnabledRO( false ) , m_nSymbolsSize( 0 ) , m_bIsSymbolsSizeRO( false ) + , m_nSidebarIconSize( 0 ) + , m_bIsSidebarIconSizeRO( false ) , m_bIsSymbolsStyleRO( false ) , m_nToolboxStyle( 1 ) , m_bIsToolboxStyleRO( false ) @@ -275,6 +286,16 @@ SvtMiscOptions_Impl::SvtMiscOptions_Impl() break; } + case PROPERTYHANDLE_SIDEBARICONSIZE : + { + if( !(seqValues[nProperty] >>= m_nSidebarIconSize) ) + { + OSL_FAIL("Wrong type of \"Misc\\SidebarIconSize\"!" ); + } + m_bIsSidebarIconSizeRO = seqRO[nProperty]; + break; + } + case PROPERTYHANDLE_TOOLBOXSTYLE : { if( !(seqValues[nProperty] >>= m_nToolboxStyle) ) @@ -404,6 +425,13 @@ void SvtMiscOptions_Impl::Load( const Sequence< OUString >& rPropertyNames ) } } break; + case PROPERTYHANDLE_SIDEBARICONSIZE : { + if( !(seqValues[nProperty] >>= m_nSidebarIconSize) ) + { + OSL_FAIL("Wrong type of \"Misc\\SidebarIconSize\"!" ); + } + } + break; case PROPERTYHANDLE_TOOLBOXSTYLE : { if( !(seqValues[nProperty] >>= m_nToolboxStyle) ) { @@ -486,6 +514,13 @@ void SvtMiscOptions_Impl::SetSymbolsSize( sal_Int16 nSet ) CallListeners(); } +void SvtMiscOptions_Impl::SetSidebarIconSize( sal_Int16 nSet ) +{ + m_nSidebarIconSize = nSet; + SetModified(); + CallListeners(); +} + OUString SvtMiscOptions_Impl::GetIconTheme() { return Application::GetSettings().GetStyleSettings().DetermineIconTheme(); @@ -553,6 +588,13 @@ void SvtMiscOptions_Impl::ImplCommit() break; } + case PROPERTYHANDLE_SIDEBARICONSIZE : + { + if ( !m_bIsSidebarIconSizeRO ) + seqValues[nProperty] <<= m_nSidebarIconSize; + break; + } + case PROPERTYHANDLE_TOOLBOXSTYLE : { if ( !m_bIsToolboxStyleRO ) @@ -634,7 +676,8 @@ Sequence< OUString > SvtMiscOptions_Impl::GetPropertyNames() OUString(PROPERTYNAME_SHOWLINKWARNINGDIALOG), OUString(PROPERTYNAME_DISABLEUICUSTOMIZATION), OUString(PROPERTYNAME_EXPERIMENTALMODE), - OUString(PROPERTYNAME_MACRORECORDERMODE) + OUString(PROPERTYNAME_MACRORECORDERMODE), + OUString(PROPERTYNAME_SIDEBARICONSIZE) }; // Initialize return sequence with these list ... @@ -701,6 +744,16 @@ void SvtMiscOptions::SetSymbolsSize( sal_Int16 nSet ) m_pImpl->SetSymbolsSize( nSet ); } +sal_Int16 SvtMiscOptions::GetSidebarIconSize() const +{ + return m_pDataContainer->GetSidebarIconSize(); +} + +void SvtMiscOptions::SetSidebarIconSize( sal_Int16 nSet ) +{ + m_pDataContainer->SetSidebarIconSize( nSet ); +} + sal_Int16 SvtMiscOptions::GetCurrentSymbolsSize() const { sal_Int16 eOptSymbolsSize = m_pImpl->GetSymbolsSize(); |