Skip to content

Commit 3fbdb31

Browse files
committed
macOS: respect strikeout attribute in menu item fonts
When we draw menu item text with CoreText instead of QPainter, then we need to translate QFont::strikeOut() explicitly to an entry in the attribute dictionary. Task-number: QTBUG-136215 Change-Id: Ic4a895cd10c950c477acffca0078718490f4f0b7 Reviewed-by: Tor Arne Vestbø <[email protected]>
1 parent 395451e commit 3fbdb31

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/plugins/styles/mac/qmacstyle_mac.mm

+3-1
Original file line numberDiff line numberDiff line change
@@ -4289,7 +4289,9 @@ static QPixmap darkenPixmap(const QPixmap &pixmap)
42894289
withAttributes:@{ NSFontAttributeName:f, NSForegroundColorAttributeName:c,
42904290
NSObliquenessAttributeName: [NSNumber numberWithDouble: myFont.italic() ? 0.3 : 0.0],
42914291
NSUnderlineStyleAttributeName: [NSNumber numberWithInt: myFont.underline() ? NSUnderlineStyleSingle
4292-
: NSUnderlineStyleNone]}];
4292+
: NSUnderlineStyleNone],
4293+
NSStrikethroughStyleAttributeName: [NSNumber numberWithInt: myFont.strikeOut() ? NSUnderlineStyleSingle
4294+
: NSUnderlineStyleNone]}];
42934295

42944296
d->restoreNSGraphicsContext(cgCtx);
42954297
} else {

0 commit comments

Comments
 (0)