summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorPhilippe Jung <phil.jung@free.fr>2015-06-18 15:19:14 +0200
committerAndras Timar <andras.timar@collabora.com>2015-08-06 12:23:10 +0200
commitf3742e41f3bd2d2aacdd6016c038fc166e6e562b (patch)
tree12485b3a6bc2304b135535a6ffe51f273ee53201 /framework
parentf9b83b18cec529a59d82c2e8c0cdafe7b933fb12 (diff)
tdf#91953 Mixture of icon sizes
Now, whatever the size of toolbar icons, the toolbar context menu always shows small icons. Change-Id: Id17df15278d74ae75a3e82d54ecf7af310e0ceb4 Reviewed-on: https://gerrit.libreoffice.org/16361 Reviewed-by: Philippe Jung <phil.jung@free.fr> Tested-by: Philippe Jung <phil.jung@free.fr> (cherry picked from commit 3090550b5297c86b63ba09ed1aa13bce4c0e5b70) Reviewed-on: https://gerrit.libreoffice.org/16365 Reviewed-by: Yousuf Philips <philipz85@hotmail.com> Tested-by: Yousuf Philips <philipz85@hotmail.com> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uielement/toolbarmanager.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index bf8fc492cc6b..e973cc4a904c 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1715,6 +1715,11 @@ bool ToolBarManager::MenuItemAllowed( sal_uInt16 ) const
if( !(pToolBar->GetFloatStyle() & WB_CLOSEABLE) )
aQuickCustomizationMenu.EnableItem(MENUITEM_TOOLBAR_CLOSE, false);
+ // Temporary stores a Command --> Url map to update contextual menu with the
+ // correct icons. The popup icons are by default the same as those in the
+ // toolbar. They are not correct for contextual popup menu.
+ std::map< OUString, Image > commandToImage;
+
// Go through all toolbar items and add them to the context menu
for ( nPos = 0; nPos < m_pToolBar->GetItemCount(); ++nPos )
{
@@ -1726,6 +1731,7 @@ bool ToolBarManager::MenuItemAllowed( sal_uInt16 ) const
pVisibleItemsPopupMenu->CheckItem( STARTID_CUSTOMIZE_POPUPMENU+nPos, m_pToolBar->IsItemVisible( nId ) );
pVisibleItemsPopupMenu->SetItemCommand( STARTID_CUSTOMIZE_POPUPMENU+nPos, aCommandURL );
Image aImage( GetImageFromURL( m_xFrame, aCommandURL, false ) );
+ commandToImage[aCommandURL] = aImage;
pVisibleItemsPopupMenu->SetItemImage( STARTID_CUSTOMIZE_POPUPMENU+nPos, aImage );
}
else
@@ -1733,6 +1739,18 @@ bool ToolBarManager::MenuItemAllowed( sal_uInt16 ) const
pVisibleItemsPopupMenu->InsertSeparator();
}
}
+
+ // Now we go through all the contextual menu to update the icons
+ std::map< OUString, Image >::iterator it;
+ for ( nPos = 0; nPos < pMenu->GetItemCount(); ++nPos )
+ {
+ sal_uInt16 nId = pMenu->GetItemId( nPos );
+ OUString cmdUrl = pMenu->GetItemCommand( nId );
+ it = commandToImage.find( cmdUrl );
+ if (it != commandToImage.end()) {
+ pMenu->SetItemImage( nId, it->second );
+ }
+ }
}
else
{