diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2021-01-15 10:31:51 +0100 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2021-01-20 07:38:50 +0100 |
commit | 96e9c8cc8aae718942f79ac98e775f06501b0e25 (patch) | |
tree | 79b3bcf6ff4061eadf02ed5ce728e36293495a79 | |
parent | c111aad270f1d51c2e870ee25e9a6bba64b3cecc (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.
Pick-to: 6.0 5.15
Fixes: QTBUG-90242
Change-Id: I559005f753b5cd19eaeeeb6658178d62de93b4ef
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-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 e7662ba5c6..a200cc0cd1 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -3789,10 +3789,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; |