summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2019-12-25 22:47:16 -0900
committerJim Raykowski <raykowj@gmail.com>2020-01-06 09:05:06 +0100
commit706be217a77d5951f02b486b8a57f20b1d061fe2 (patch)
treeb71b7cae25f552806ceb0b09b97ef886af773fcc /framework
parent7a98ab1fa6b3f3de2c7077c1d2601f7bc12be2d7 (diff)
Display menu item keyboard shortcuts in toolbar menu
Change-Id: I288d4850f9a8e9ac51dfefddff7a2a7d359178c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85832 Tested-by: Jenkins Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/uielement/toolbarmanager.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx
index 56d12dddb0fb..9e17204f3b7e 100644
--- a/framework/source/uielement/toolbarmanager.cxx
+++ b/framework/source/uielement/toolbarmanager.cxx
@@ -1515,6 +1515,8 @@ void ToolBarManager::AddCustomizeMenuItems(ToolBox const * pToolBar)
Image aImage(vcl::CommandInfoProvider::GetImageForCommand(aCommandURL, m_xFrame));
commandToImage[aCommandURL] = aImage;
xVisibleItemsPopupMenu->SetItemImage( STARTID_CUSTOMIZE_POPUPMENU+nPos, aImage );
+ vcl::KeyCode aKeyCodeShortCut = vcl::CommandInfoProvider::GetCommandKeyCodeShortcut( aCommandURL, m_xFrame );
+ xVisibleItemsPopupMenu->SetAccelKey( STARTID_CUSTOMIZE_POPUPMENU+nPos, aKeyCodeShortCut );
}
else
{
@@ -1524,6 +1526,7 @@ void ToolBarManager::AddCustomizeMenuItems(ToolBox const * pToolBar)
}
// Now we go through all the contextual menu to update the icons
+ // and accelerator key shortcuts
std::map< OUString, Image >::iterator it;
for ( sal_uInt16 nPos = 0; nPos < pMenu->GetItemCount(); ++nPos )
{
@@ -1533,6 +1536,9 @@ void ToolBarManager::AddCustomizeMenuItems(ToolBox const * pToolBar)
if (it != commandToImage.end()) {
pMenu->SetItemImage( nId, it->second );
}
+ vcl::KeyCode aKeyCodeShortCut = vcl::CommandInfoProvider::GetCommandKeyCodeShortcut( cmdUrl, m_xFrame );
+ if ( aKeyCodeShortCut.GetFullCode() != 0 )
+ pMenu->SetAccelKey( nId, aKeyCodeShortCut );
}
}