diff options
author | Jim Raykowski <raykowj@gmail.com> | 2018-10-11 21:37:24 -0800 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2018-11-05 08:48:56 +0100 |
commit | 5e45ff5241546ce564eccefcc8b7fff876801415 (patch) | |
tree | d2a71ed51e07e618b73332e7cb34685c8b09d679 /sfx2 | |
parent | cd086621e3d4fd4b90fabe0b20c0ae4602447d8a (diff) |
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@cib.de>
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/sidebar/FocusManager.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
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) { |