Kaydet (Commit) f6e7dbcc authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

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: 's avatarJan-Marek Glogowski <glogow@fbihome.de>
üst 2574ce0f
...@@ -631,6 +631,7 @@ void Qt5Menu::ShowCloseButton(bool bShow) ...@@ -631,6 +631,7 @@ void Qt5Menu::ShowCloseButton(bool bShow)
pButton = new QPushButton(mpQMenuBar); pButton = new QPushButton(mpQMenuBar);
pButton->setIcon(aIcon); pButton->setIcon(aIcon);
pButton->setFlat(true); pButton->setFlat(true);
pButton->setFocusPolicy(Qt::NoFocus);
pButton->setToolTip(toQString(VclResId(SV_HELPTEXT_CLOSEDOCUMENT))); pButton->setToolTip(toQString(VclResId(SV_HELPTEXT_CLOSEDOCUMENT)));
mpQMenuBar->setCornerWidget(pButton, Qt::TopRightCorner); mpQMenuBar->setCornerWidget(pButton, Qt::TopRightCorner);
maCloseButtonConnection maCloseButtonConnection
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment