[Libreoffice-commits] core.git: vcl/qt5
Jan-Marek Glogowski (via logerrit)
logerrit at kemper.freedesktop.org
Thu May 30 00:10:41 UTC 2019
vcl/qt5/Qt5Menu.cxx | 1 +
1 file changed, 1 insertion(+)
New commits:
commit f6e7dbccf063767c2ac87c6460bd1004df742081
Author: Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Wed May 29 19:45:24 2019 +0200
Commit: Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Thu May 30 02:09:32 2019 +0200
tdf#125548 Qt5 no focus for the menu bar button
You can't tab into the menu bar, but if you add a corner widget,
it will be enlisted in the parent's focus chain! Interestingly
the menu bar even is considered to have the focus, if the widget
is focused, and will handle key events, but this can probably be
considered consistent.
So this just denies the button any focus, as this is a mouse-only
widget, and clicking it will close the document window.
Change-Id: I3c48d85ca56b6a54daf01f444dddc736e7ebb8e7
Reviewed-on: https://gerrit.libreoffice.org/73186
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx
index 733b1505b49c..435cc53363d4 100644
--- a/vcl/qt5/Qt5Menu.cxx
+++ b/vcl/qt5/Qt5Menu.cxx
@@ -631,6 +631,7 @@ void Qt5Menu::ShowCloseButton(bool bShow)
pButton = new QPushButton(mpQMenuBar);
pButton->setIcon(aIcon);
pButton->setFlat(true);
+ pButton->setFocusPolicy(Qt::NoFocus);
pButton->setToolTip(toQString(VclResId(SV_HELPTEXT_CLOSEDOCUMENT)));
mpQMenuBar->setCornerWidget(pButton, Qt::TopRightCorner);
maCloseButtonConnection
More information about the Libreoffice-commits
mailing list