summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail..com>2019-07-15 23:41:55 -0800
committerXisco Faulí <xiscofauli@libreoffice.org>2019-08-02 17:18:44 +0200
commit32cf2f6614526e560623498afe4d80b29fc52649 (patch)
treeb492b73e27efd47a029aff89fb440856a5ba8060 /sc
parent222e3782dfa885370c5adbaf87aeed4fcbb5f107 (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> (cherry picked from commit 3e50aea3c723e82ea4acf32aae8d72e875d4b321) Reviewed-on: https://gerrit.libreoffice.org/76532 Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org> (cherry picked from commit f111aba46cbb037bd82d7246bb0a111b87931f03) Reviewed-on: https://gerrit.libreoffice.org/76564
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 492c64b3d1c7..587e2e41a353 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1207,6 +1207,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)
@@ -1282,7 +1283,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 )
@@ -1320,14 +1328,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;
}
}