diff options
author | Liang Qi <liang.qi@qt.io> | 2019-05-15 07:11:41 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-05-15 07:11:41 +0200 |
commit | c0359bd3c3a098ace9d2fa7ee91c33b24a8d9477 (patch) | |
tree | 9bcae3bff2ccef2b020c7a9ef25b3643e9ae556f /src/plugins/styles/mac | |
parent | 68eea0196ebf30617e7d837ac5f61aaeeb814692 (diff) | |
parent | 1e5deb06416b6efc33a2009d9678fd8f743c5ce7 (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
src/corelib/global/qfloat16.cpp
src/corelib/global/qfloat16.h
src/plugins/platforms/windows/qwindowswindow.cpp
Change-Id: I0938aaa6a9771f55e48c95ed29f6f5291431b947
Diffstat (limited to 'src/plugins/styles/mac')
-rw-r--r-- | src/plugins/styles/mac/qmacstyle_mac.mm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index 288e4cd29a..3474e82c13 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -4290,12 +4290,15 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter alpha:pc.alphaF()]; s = qt_mac_removeMnemonics(s); - const auto textRect = CGRectMake(xpos, yPos, mi->rect.width() - xm - tabwidth + 1, mi->rect.height()); QMacCGContext cgCtx(p); d->setupNSGraphicsContext(cgCtx, YES); - [s.toNSString() drawInRect:textRect + // Draw at point instead of in rect, as the rect we've computed for the menu item + // is based on the font metrics we got from HarfBuzz, so we may risk having CoreText + // line-break the string if it doesn't fit the given rect. It's better to draw outside + // the rect and possibly overlap something than to have part of the text disappear. + [s.toNSString() drawAtPoint:CGPointMake(xpos, yPos) withAttributes:@{ NSFontAttributeName:f, NSForegroundColorAttributeName:c, NSObliquenessAttributeName: [NSNumber numberWithDouble: myFont.italic() ? 0.3 : 0.0]}]; |