summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail..com>2019-07-15 23:41:55 -0800
committerJim Raykowski <raykowj@gmail.com>2019-07-23 07:58:10 +0200
commit3e50aea3c723e82ea4acf32aae8d72e875d4b321 (patch)
treef38d48fc95ec92f8fa975966601cd98d5a042f52 /sc
parentac933bb93a7afa8af10382cf2d47e64b31fe2567 (diff)
tdf#122774 Make all ScCheckListMenuWindow items keyboard accessible
This patch provides keyboard tab navigation to the menu window menu items. In addition to the Ok button being already disabled when search is empty the patch disables the check list box, toggle all check box select, single button and unselect single button. This prevents keyboard focus from being trapped in the check list box and from tab navigation visting useless controls when search is empty. This patch also provides a hack fix for tdf#122772 Change-Id: I7677d544ae63acc8eca08877ecd001d394fcfaca Reviewed-on: https://gerrit.libreoffice.org/75684 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/cctrl/checklistmenu.cxx31
1 files changed, 26 insertions, 5 deletions
diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx
index 2b74bfd3d605..43553d305f38 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1210,6 +1210,7 @@ IMPL_LINK_NOARG(ScCheckListMenuWindow, TriStateHdl, Button*, void)
}
mePrevToggleAllState = maChkToggleAll->GetState();
+ maTabStops.SetTabStop(maChkToggleAll); // Needed for when accelerator is used
}
IMPL_LINK_NOARG(ScCheckListMenuWindow, EdModifyHdl, Edit&, void)
@@ -1285,7 +1286,14 @@ IMPL_LINK_NOARG(ScCheckListMenuWindow, EdModifyHdl, Edit&, void)
maChkToggleAll->SetState( TRISTATE_INDET );
if ( !maConfig.mbAllowEmptySet )
- maBtnOk->Enable( nSelCount != 0);
+ {
+ const bool bEmptySet( nSelCount == 0 );
+ maChecks->Enable( !bEmptySet );
+ maChkToggleAll->Enable( !bEmptySet );
+ maBtnSelectSingle->Enable( !bEmptySet );
+ maBtnUnselectSingle->Enable( !bEmptySet );
+ maBtnOk->Enable( !bEmptySet );
+ }
}
IMPL_LINK( ScCheckListMenuWindow, CheckHdl, SvTreeListBox*, pChecks, void )
@@ -1323,14 +1331,27 @@ void ScCheckListMenuWindow::MouseMove(const MouseEvent& rMEvt)
bool ScCheckListMenuWindow::EventNotify(NotifyEvent& rNEvt)
{
- if (rNEvt.GetType() == MouseNotifyEvent::KEYUP)
+ MouseNotifyEvent nType = rNEvt.GetType();
+ if (HasFocus() && nType == MouseNotifyEvent::GETFOCUS)
+ {
+ setSelectedMenuItem( 0 , false, false );
+ return true;
+ }
+ if (nType == MouseNotifyEvent::KEYINPUT)
{
const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
const vcl::KeyCode& rCode = pKeyEvent->GetKeyCode();
- bool bShift = rCode.IsShift();
- if (rCode.GetCode() == KEY_TAB)
+ const sal_uInt16 nCode = rCode.GetCode();
+ if (rCode.IsMod2()) // Hack to prevent tdf#122772
+ {
+ if (nCode == KEY_DOWN || nCode == KEY_RIGHT)
+ return true;
+ }
+ else
{
- maTabStops.CycleFocus(bShift);
+ bool bShift = rCode.IsShift();
+ if (nCode == KEY_TAB)
+ maTabStops.CycleFocus(bShift);
return true;
}
}