summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2019-05-29 19:45:24 +0200
committerKatarina Behrens <Katarina.Behrens@cib.de>2019-05-30 08:53:31 +0200
commited200895d4a2bc31ca99d4e41abaae7dce73ffa1 (patch)
tree34b8ef288365d681c335037be338e1fad7785f6e /vcl
parentebae54a6fde07a08e0b666b56dbd654691e5c416 (diff)
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@fbihome.de> (cherry picked from commit f6e7dbccf063767c2ac87c6460bd1004df742081) Reviewed-on: https://gerrit.libreoffice.org/73191 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qt5/Qt5Menu.cxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/vcl/qt5/Qt5Menu.cxx b/vcl/qt5/Qt5Menu.cxx
index 47613988beac..0eeafb89f85d 100644
--- a/vcl/qt5/Qt5Menu.cxx
+++ b/vcl/qt5/Qt5Menu.cxx
@@ -622,6 +622,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);
}