[Libreoffice-commits] core.git: sfx2/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Nov 5 07:49:47 UTC 2018


 sfx2/source/sidebar/FocusManager.cxx |   22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

New commits:
commit 5e45ff5241546ce564eccefcc8b7fff876801415
Author:     Jim Raykowski <raykowj at gmail.com>
AuthorDate: Thu Oct 11 21:37:24 2018 -0800
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Mon Nov 5 08:48:56 2018 +0100

    tdf#120534 Make escape key focus to document from sidebar
    
    from all locations other than panel content
    
    Change-Id: I85a113d3001338dd1aff27bac75a5debd4635d59
    Reviewed-on: https://gerrit.libreoffice.org/62808
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/sfx2/source/sidebar/FocusManager.cxx b/sfx2/source/sidebar/FocusManager.cxx
index 9645cb182f4d..610e28a4b66f 100644
--- a/sfx2/source/sidebar/FocusManager.cxx
+++ b/sfx2/source/sidebar/FocusManager.cxx
@@ -27,6 +27,8 @@
 #include <vcl/toolbox.hxx>
 #include <toolkit/helper/vclunohelper.hxx>
 
+#include <sfx2/app.hxx>
+
 namespace sfx2 { namespace sidebar {
 
 FocusManager::FocusLocation::FocusLocation (const PanelComponent eComponent, const sal_Int32 nIndex)
@@ -371,6 +373,26 @@ void FocusManager::HandleKeyEvent (
 
     switch (rKeyCode.GetCode())
     {
+        case KEY_ESCAPE:
+            switch (aLocation.meComponent)
+            {
+                case PC_TabBar:
+                case PC_DeckTitle:
+                case PC_DeckToolBox:
+                case PC_PanelTitle:
+                case PC_PanelToolBox:
+                {
+                    vcl::Window* pFocusWin = Application::GetFocusWindow();
+                    if (pFocusWin)
+                        pFocusWin->GrabFocusToDocument();
+                    break;
+                }
+
+                default:
+                    break;
+            }
+            return;
+
         case KEY_SPACE:
             switch (aLocation.meComponent)
             {


More information about the Libreoffice-commits mailing list