tdf#92049 NewMenuController: track icon theme changes too

Change-Id: I2f2c990b2cbacddf94bf74329d641d5a7e489773
This commit is contained in:
Maxim Monastirsky
2016-03-17 01:05:52 +02:00
parent e7d405b74e
commit 1caac28389
2 changed files with 5 additions and 1 deletions

View File

@@ -96,6 +96,7 @@ namespace framework
m_bNewMenu : 1, m_bNewMenu : 1,
m_bModuleIdentified : 1, m_bModuleIdentified : 1,
m_bAcceleratorCfg : 1; m_bAcceleratorCfg : 1;
OUString m_aIconTheme;
OUString m_aTargetFrame; OUString m_aTargetFrame;
OUString m_aModuleIdentifier; OUString m_aModuleIdentifier;
OUString m_aEmptyDocURL; OUString m_aEmptyDocURL;

View File

@@ -471,12 +471,14 @@ void SAL_CALL NewMenuController::itemActivated( const css::awt::MenuEvent& ) thr
{ {
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
bool bShowImages( rSettings.GetUseImagesInMenus() ); bool bShowImages( rSettings.GetUseImagesInMenus() );
OUString aIconTheme( rSettings.DetermineIconTheme() );
PopupMenu* pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu()); PopupMenu* pVCLPopupMenu = static_cast<PopupMenu *>(pPopupMenu->GetMenu());
if ( m_bShowImages != bShowImages ) if ( m_bShowImages != bShowImages || m_aIconTheme != aIconTheme )
{ {
m_bShowImages = bShowImages; m_bShowImages = bShowImages;
m_aIconTheme = aIconTheme;
setMenuImages( pVCLPopupMenu, m_bShowImages ); setMenuImages( pVCLPopupMenu, m_bShowImages );
} }
@@ -540,6 +542,7 @@ void SAL_CALL NewMenuController::initialize( const Sequence< Any >& aArguments )
const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings();
m_bShowImages = rSettings.GetUseImagesInMenus(); m_bShowImages = rSettings.GetUseImagesInMenus();
m_aIconTheme = rSettings.DetermineIconTheme();
m_bNewMenu = m_aCommandURL == aSlotNewDocDirect; m_bNewMenu = m_aCommandURL == aSlotNewDocDirect;
} }
} }