diff options
author | Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> | 2024-06-22 22:04:39 +0300 |
---|---|---|
committer | Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> | 2024-06-25 08:10:04 +0200 |
commit | 3bf923428f75506e16a99805c00c1cc8eff28f40 (patch) | |
tree | 7af8466799b03a14c11d9290bed99f45d8834b61 /sc | |
parent | b7bec979f2602bad759b4e018284c2779f215c00 (diff) |
tdf#161743 Calc Sidebar Functions deck: move focus to document upon
Esc while in empty search field
Change-Id: I7bb6aaeb69712b293c74bfcf34ab65c4869c860c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169352
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
(cherry picked from commit 1f26aa7f42795aed775646cbb616f5ee4e60326c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169442
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/formdlg/dwfunctr.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx index 355a820f4f87..96df2105bfbe 100644 --- a/sc/source/ui/formdlg/dwfunctr.cxx +++ b/sc/source/ui/formdlg/dwfunctr.cxx @@ -443,6 +443,20 @@ IMPL_LINK(ScFunctionWin, KeyInputHdl, const KeyEvent&, rEvent, bool) break; case KEY_ESCAPE: { + // Escape in an empty search field should move focus to the document, + // adhering to Sidebar guidelines + if (m_xSearchString->get_text().isEmpty()) + { + if (SfxViewShell* pCurSh = SfxViewShell::Current()) + { + vcl::Window* pShellWnd = pCurSh->GetWindow(); + + if (pShellWnd) + pShellWnd->GrabFocusToDocument(); + } + bHandled = true; + break; + } m_xSearchString->set_text(u""_ustr); UpdateFunctionList(u""_ustr); bHandled = true; |