summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2020-10-21 01:08:01 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2020-10-22 12:21:39 +0200
commit3f7515258e91266f10e5c7bafee2d3d6fa9c91c2 (patch)
tree90119a7ffdccc7db70daa3a5b3edb3a7441a1409 /vcl
parent2859febef0dd59e6714032887f1f4ababf0b1044 (diff)
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@fbihome.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/control/button.cxx4
1 files changed, 3 insertions, 1 deletions
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()*/);