QMacStyle: Increase accuracy of PM_TitleBarHeight

In some cases, we'd want such value to come from the
platform theme, but we'd need new API for this.

Change-Id: Ic7053fa17ac8b2f207db031095c4e4aefae000c2
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
bb10
Gabriel de Dietrich 2017-04-28 14:51:36 -07:00
parent a4192166c8
commit 68df0576dd
1 changed files with 6 additions and 4 deletions

View File

@ -2470,11 +2470,13 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
case PM_ButtonDefaultIndicator:
ret = 0;
break;
case PM_TitleBarHeight:
// Always use NSTitledWindowMask since we never need any other type of window here
case PM_TitleBarHeight: {
NSUInteger style = NSTitledWindowMask;
if (widget && ((widget->windowFlags() & Qt::Tool) == Qt::Tool))
style |= NSUtilityWindowMask;
ret = int([NSWindow frameRectForContentRect:NSZeroRect
styleMask:NSTitledWindowMask].size.height);
break;
styleMask:style].size.height);
break; }
case QStyle::PM_TabBarTabHSpace:
switch (d->aquaSizeConstrain(opt, widget)) {
case QAquaSizeLarge: