Related: tdf#151351 kf5 pressed flat toggle buttons not visually depressed
Change-Id: I3ab2ec91f3317dbd5a7e011e5b81d0a5141b1348
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140978
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 86eae5b..0edb9d9 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1124,7 +1124,7 @@ 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 (!aControlValue.m_bFlatButton || (nState & ControlState::ROLLOVER) || (nState & ControlState::PRESSED)
|| (HasFocus() && mpWindowImpl->mbUseNativeFocus
&& !IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Focus)))
{