diff options
author | Doris Verria <doris.verria@qt.io> | 2021-03-30 14:03:43 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-04-06 15:21:33 +0000 |
commit | 05bb808309448580e11fb805b64edaa8e7236d84 (patch) | |
tree | d066e781e0ea68b233aa511f93bb916a0ebc4140 /src | |
parent | 80a02a05794271058aee7962ff86fc1ab2014962 (diff) |
Fix incorrectly-drawn menu indicator for QPushButton on macOS
Because the QPushButton's bevel rect is smaller than its actual
widget's rect, custom styled menu indicators are drawn outside the
bevel frame on macOS. Fix this by drawing the menu indicator inside the
bevel's rect instead of the widget's rect.
Fixes: QTBUG-90250
Change-Id: Ie63d68d8f564a4a640bdb8e7564f028784faab97
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 0eb0fc87014b8de06473055bd2298b2423d480f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index d0809b87bc..fedc312c7a 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -3527,7 +3527,8 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q if (btn->features & QStyleOptionButton::HasMenu) { QRenderRule subRule = renderRule(w, opt, PseudoElement_PushButtonMenuIndicator); - QRect ir = positionRect(w, rule, subRule, PseudoElement_PushButtonMenuIndicator, opt->rect, opt->direction); + QRect ir = positionRect(w, rule, subRule, PseudoElement_PushButtonMenuIndicator, + baseStyle()->subElementRect(SE_PushButtonBevel, btn, w), opt->direction); if (subRule.hasDrawable()) { subRule.drawRule(p, ir); } else { |