tdf#161782 Focus document when Esc is pressed in the Gallery/Navigator

When Esc is pressed on a Panel that has no visible title, move focus to the document.

Change-Id: Ib5571dbd9f8a37017e21d2e01e7b546eb2330751
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169668
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Reviewed-by: Rafael Lima <rafael.palma.lima@gmail.com>
Tested-by: Jenkins
This commit is contained in:
Rafael Lima 2024-06-27 22:59:47 +02:00
parent 76f4e6d976
commit 6113d5dc45

View file

@ -298,10 +298,12 @@ bool FocusManager::HandleKeyEvent(
}
case PC_PanelContent:
// Return focus to tab bar sidebar settings button or panel title.
if (!IsDeckTitleVisible() && maPanels.size() == 1)
if ((!IsDeckTitleVisible() && maPanels.size() == 1) ||
(!maPanels[aLocation.mnIndex]->GetTitleBar()->GetVisible()))
FocusButton(0);
else
FocusPanel(aLocation.mnIndex, true);
bConsumed = true;
break;
default: