include/vcl/salnativewidgets.hxx | 2 ++ vcl/qt5/Qt5Graphics_Controls.cxx | 5 +++++ vcl/source/control/button.cxx | 2 ++ 3 files changed, 9 insertions(+)
New commits: commit c519dd2ea19cb6c53c29aeeb67e263f6b9f832b2 Author: Jan-Marek Glogowski <glo...@fbihome.de> AuthorDate: Wed Oct 21 17:40:09 2020 +0200 Commit: Jan-Marek Glogowski <glo...@fbihome.de> CommitDate: Thu Oct 22 12:22:09 2020 +0200 Qt5 forward the flat push button style Change-Id: I0835f66b8ce478f645ca2e5c376bef9a0740c8c8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104637 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glo...@fbihome.de> diff --git a/include/vcl/salnativewidgets.hxx b/include/vcl/salnativewidgets.hxx index faa273b3f571..75c25d3f0fe0 100644 --- a/include/vcl/salnativewidgets.hxx +++ b/include/vcl/salnativewidgets.hxx @@ -519,6 +519,7 @@ public: , mbBevelButton(false) , mbSingleLine(true) , mbIsAction(false) + , m_bFlatButton(false) {} virtual ~PushButtonValue() override; @@ -532,6 +533,7 @@ public: bool mbBevelButton:1; // only used on OSX bool mbSingleLine:1; // only used on OSX bool mbIsAction:1; + bool m_bFlatButton:1; }; diff --git a/vcl/qt5/Qt5Graphics_Controls.cxx b/vcl/qt5/Qt5Graphics_Controls.cxx index b28734b4aefc..6f88d66a1c3b 100644 --- a/vcl/qt5/Qt5Graphics_Controls.cxx +++ b/vcl/qt5/Qt5Graphics_Controls.cxx @@ -306,8 +306,13 @@ bool Qt5Graphics_Controls::drawNativeControl(ControlType type, ControlPart part, if (type == ControlType::Pushbutton) { + const PushButtonValue& rPBValue = static_cast<const PushButtonValue&>(value); assert(part == ControlPart::Entire); QStyleOptionButton option; + if (nControlState & ControlState::DEFAULT) + option.features |= QStyleOptionButton::DefaultButton; + if (rPBValue.m_bFlatButton) + option.features |= QStyleOptionButton::Flat; draw(QStyle::CE_PushButton, option, m_image.get(), rBackgroundColor, vclStateValue2StateFlag(nControlState, value)); } diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index ead095de7a74..66a399c15bbc 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -999,6 +999,8 @@ void PushButton::ImplDrawPushButton(vcl::RenderContext& rRenderContext) nButtonStyle &= ~DrawButtonFlags::Pressed; } + if (GetStyle() & WB_FLATBUTTON) + aControlValue.m_bFlatButton = true; if (GetStyle() & WB_BEVELBUTTON) aControlValue.mbBevelButton = true; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits