summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2018-02-08 18:27:56 -0900
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-03-14 00:33:45 +0100
commit6d2f6f2f01a4fbf244ba16c355d2f43a2ddf671e (patch)
tree72414e6a66dfe6b561e4dda7d1fab6d97c45f859
parent32f42d093d4408666151d03f04823e2bb39e46cd (diff)
tdf#115565 Change tab key behavior to navigate out of gotopage control
...in Writer Sidebar Navigator deck helper toolbox Change-Id: Ieeabcb30f421aa0ce2a5f841e45fff5f57358215 Reviewed-on: https://gerrit.libreoffice.org/50295 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--include/vcl/toolbox.hxx2
-rw-r--r--sfx2/source/sidebar/FocusManager.cxx6
-rw-r--r--sw/source/uibase/cctrl/actctrl.cxx15
-rw-r--r--vcl/source/window/toolbox.cxx5
4 files changed, 25 insertions, 3 deletions
diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index 700da27363fb..92382df66bce 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -510,6 +510,8 @@ public:
static Size GetDefaultImageSize(ToolBoxButtonSize eToolBoxButtonSize);
Size GetDefaultImageSize() const;
void ChangeHighlight( ImplToolItems::size_type nPos );
+ bool ChangeHighlightUpDn( bool bUp, bool bNoCyle = false );
+
void SetToolbarLayoutMode( ToolBoxLayoutMode eLayout );
void statusChanged(const css::frame::FeatureStateEvent& rEvent);
diff --git a/sfx2/source/sidebar/FocusManager.cxx b/sfx2/source/sidebar/FocusManager.cxx
index 78cb149ba0bf..9872e34817e6 100644
--- a/sfx2/source/sidebar/FocusManager.cxx
+++ b/sfx2/source/sidebar/FocusManager.cxx
@@ -571,13 +571,17 @@ IMPL_LINK(FocusManager, ChildEventListener, VclWindowEvent&, rEvent, void)
break;
case KEY_TAB:
+ {
+ WindowType aWindowType = pSource->GetType();
if (mpFirstFocusedContentControl!=nullptr
- && mpLastFocusedWindow == mpFirstFocusedContentControl)
+ && ( mpLastFocusedWindow == mpFirstFocusedContentControl
+ && !( WindowType::EDIT == aWindowType || WindowType::SPINFIELD == aWindowType ) ))
{
// Move focus back to panel (or deck)
// title.
FocusPanel(aLocation.mnIndex, true);
}
+ }
break;
default:
diff --git a/sw/source/uibase/cctrl/actctrl.cxx b/sw/source/uibase/cctrl/actctrl.cxx
index 7e97dab5ce97..0c7afd70a8f6 100644
--- a/sw/source/uibase/cctrl/actctrl.cxx
+++ b/sw/source/uibase/cctrl/actctrl.cxx
@@ -20,6 +20,7 @@
#include <comphelper/string.hxx>
#include <vcl/builderfactory.hxx>
#include <actctrl.hxx>
+#include <vcl/toolbox.hxx>
bool NumEditAction::EventNotify( NotifyEvent& rNEvt )
{
@@ -29,14 +30,24 @@ bool NumEditAction::EventNotify( NotifyEvent& rNEvt )
{
const KeyEvent* pKEvt = rNEvt.GetKeyEvent();
const vcl::KeyCode aKeyCode = pKEvt->GetKeyCode();
+ const sal_uInt16 aCode = aKeyCode.GetCode();
const sal_uInt16 nModifier = aKeyCode.GetModifier();
- if( aKeyCode.GetCode() == KEY_RETURN &&
+ if( aCode == KEY_RETURN &&
!nModifier)
{
aActionLink.Call( *this );
bHandled = true;
}
-
+ else
+ {
+ vcl::Window* pParent = GetParent();
+ if ( pParent != nullptr && aCode == KEY_TAB &&
+ pParent->GetType() == WindowType::TOOLBOX )
+ {
+ static_cast<ToolBox*>(pParent)->ChangeHighlightUpDn( aKeyCode.IsShift() );
+ bHandled = true;
+ }
+ }
}
if(!bHandled)
NumericField::EventNotify(rNEvt);
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 35c8e3a7c2af..5e7b424c1392 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -4890,6 +4890,11 @@ static bool ImplIsValidItem( const ImplToolItem* pItem, bool bNotClipped )
return bValid;
}
+bool ToolBox::ChangeHighlightUpDn( bool bUp, bool bNoCyle )
+{
+ return ImplChangeHighlightUpDn(bUp, bNoCyle);
+}
+
bool ToolBox::ImplChangeHighlightUpDn( bool bUp, bool bNoCycle )
{
ImplToolItem* pToolItem = ImplGetItem( mnHighItemId );