[Libreoffice-commits] core.git: vcl/source
Jan-Marek Glogowski (via logerrit)
logerrit at kemper.freedesktop.org
Thu Oct 22 10:22:18 UTC 2020
vcl/source/control/button.cxx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit 3f7515258e91266f10e5c7bafee2d3d6fa9c91c2
Author: Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Wed Oct 21 01:08:01 2020 +0200
Commit: Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Thu Oct 22 12:21:39 2020 +0200
tdf#137660 send some focus event for push buttons
With KDE breeze we don't get any focus indicator for the keyboard
navigation in the start center, with either the kf5 or the gtk3
plugin using breeze. gtk3 with adwaita works fine, because it can
handle the ControlPart::Focus of the push button.
This behaviour was introduced in #i110915#. In the gen plugin
you get a small focus rect inside the button, but kf5 and gtk3
set mbNoFocusRectsForFlatButtons, which was introduced by commit
f485b2881794244409d71ead39715373e734ed04, so there isn't any
indicator left for kf5 for the keyboard focus.
So this sends focus updates for the flat buttons, if the focus
rects are disabled and ControlPart::Focus is not supported, so
kf5 can render a focus indicator.
Change-Id: I1b587a7f9ec55b44369c4c8bc21039fe90aab9ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104582
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 45e4876a11ae..ead095de7a74 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1021,7 +1021,9 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext)
Size aInRectSize(rRenderContext.LogicToPixel(Size(aInRect.GetWidth(), aInRect.GetHeight())));
aControlValue.mbSingleLine = (aInRectSize.Height() < 2 * aFontSize.Height());
- if ((nState & ControlState::ROLLOVER) || !(GetStyle() & WB_FLATBUTTON))
+ if ((nState & ControlState::ROLLOVER) || !(GetStyle() & WB_FLATBUTTON)
+ || (HasFocus() && mpWindowImpl->mbUseNativeFocus
+ && !IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Focus)))
{
bNativeOK = rRenderContext.DrawNativeControl(ControlType::Pushbutton, ControlPart::Entire, aCtrlRegion, nState,
aControlValue, OUString() /*PushButton::GetText()*/);
More information about the Libreoffice-commits
mailing list