diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2021-01-15 10:31:51 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-04-14 12:13:27 +0000 |
commit | fa2efb8b3577c69fee305c0d74f6996bbf84bd7a (patch) | |
tree | b2d8e2ae4820308c2307bd14ab783268d1e30e6d /src | |
parent | 22b9e8f8893cc478190af22940b095a02771b3a8 (diff) |
Correct item indent in checkable menus in stylesheet style
Not only the checkable items need to be indented, but all items in the
same menu, so that they line up.
Fixes: QTBUG-90242
Change-Id: I559005f753b5cd19eaeeeb6658178d62de93b4ef
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 96e9c8cc8aae718942f79ac98e775f06501b0e25)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index a68668802e..315e2dcc0c 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -3794,10 +3794,10 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q QRect pmr(0, 0, pixw, pixh); pmr.moveCenter(iconRect.center()); p->drawPixmap(pmr.topLeft(), pixmap); - } else if (checkable) { + } else if (mi.menuHasCheckableItems) { QRenderRule subSubRule = renderRule(w, opt, PseudoElement_MenuCheckMark); const QRect cmRect = positionRect(w, subRule, subSubRule, PseudoElement_MenuCheckMark, opt->rect, opt->direction); - if (subSubRule.hasDrawable() || checked) { + if (checkable && (subSubRule.hasDrawable() || checked)) { QStyleOptionMenuItem newMi = mi; if (!dis) newMi.state |= State_Enabled; |