diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2016-09-14 02:02:38 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2016-09-13 23:06:38 +0000 |
commit | 74fd959945dbbfbc3dcc331a08ff8fc7c6410295 (patch) | |
tree | dbabc8792b2d774cb8d7d456bb3b2765a73484e4 /cui/source/options/optgdlg.cxx | |
parent | ebe46f14a266f7e538bc8b8fa6b9f7d78c5e308d (diff) |
tdf#74377 Keyboard shortcuts for context menus
Configurable through the options dialog. The default behavior
depends on the current vclplug (hide for gtk2/3 and OS X, show
otherwise).
Menus currently affected by this change:
- SfxDispatcher based context menus
- chart2 context menus
- vcl's Edit control context menu
- Several MenuBarManager based toolbar dropdowns.
Change-Id: Iad9fb99dc90e01c17cba9c07c1a2b262b920e11d
Reviewed-on: https://gerrit.libreoffice.org/28849
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Tested-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'cui/source/options/optgdlg.cxx')
-rw-r--r-- | cui/source/options/optgdlg.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 0371321bc041..4c59db28ebe3 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -630,6 +630,7 @@ OfaViewTabPage::OfaViewTabPage(vcl::Window* pParent, const SfxItemSet& rSet) get(m_pAAPointLimitLabel, "aafrom"); get(m_pAAPointLimit, "aanf"); get(m_pMenuIconsLB, "menuicons"); + get(m_pContextMenuShortcutsLB, "contextmenushortcuts"); get(m_pFontShowCB, "showfontpreview"); get(m_pUseHardwareAccell, "useaccel"); get(m_pUseAntiAliase, "useaa"); @@ -711,6 +712,7 @@ void OfaViewTabPage::dispose() m_pAAPointLimitLabel.clear(); m_pAAPointLimit.clear(); m_pMenuIconsLB.clear(); + m_pContextMenuShortcutsLB.clear(); m_pFontShowCB.clear(); m_pUseHardwareAccell.clear(); m_pUseAntiAliase.clear(); @@ -867,6 +869,16 @@ bool OfaViewTabPage::FillItemSet( SfxItemSet* ) bAppearanceChanged = true; } + if(m_pContextMenuShortcutsLB->IsValueChangedFromSaved()) + { + aMenuOpt.SetContextMenuShortcuts(m_pContextMenuShortcutsLB->GetSelectEntryPos() == 0 ? + TRISTATE_INDET : + static_cast<TriState>(m_pContextMenuShortcutsLB->GetSelectEntryPos() - 1)); + bModified = true; + bMenuOptModified = true; + bAppearanceChanged = true; + } + // #i95644# if disabled, do not use value, see in ::Reset() if(m_pUseHardwareAccell->IsEnabled()) { @@ -994,6 +1006,11 @@ void OfaViewTabPage::Reset( const SfxItemSet* ) m_pMenuIconsLB->SelectEntryPos(aMenuOpt.GetMenuIconsState() == 2 ? 0 : aMenuOpt.GetMenuIconsState() + 1); m_pMenuIconsLB->SaveValue(); + TriState eContextMenuShortcuts = aMenuOpt.GetContextMenuShortcuts(); + bool bContextMenuShortcutsNonDefault = eContextMenuShortcuts == TRISTATE_FALSE || eContextMenuShortcuts == TRISTATE_TRUE; + m_pContextMenuShortcutsLB->SelectEntryPos(bContextMenuShortcutsNonDefault ? eContextMenuShortcuts + 1 : 0); + m_pContextMenuShortcutsLB->SaveValue(); + { // #i95644# HW accel (unified to disable mechanism) if(pCanvasSettings->IsHardwareAccelerationAvailable()) { |