Mac Style: Fix non-native menubar item spacing

Unfortunate consequence from inheriting from Common style instead of
Windows style.

Also, a font entry missing in QCocoaTheme.

Task-number: QTBUG-36224
Change-Id: I560494b1727734671478f70ee1ba800d21c916ca
Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com>
This commit is contained in:
Gabriel de Dietrich 2014-01-21 12:59:10 +01:00 committed by The Qt Project
parent 0839c4779f
commit 3fadd88f30
2 changed files with 9 additions and 0 deletions

View File

@ -254,6 +254,7 @@ QHash<QPlatformTheme::Font, QFont *> qt_mac_createRoleFonts()
fonts.insert(QPlatformTheme::ListBoxFont, qt_mac_qfontForThemeFont(kThemeViewsFont));
fonts.insert(QPlatformTheme::TitleBarFont, qt_mac_qfontForThemeFont(kThemeWindowTitleFont));
fonts.insert(QPlatformTheme::MenuFont, qt_mac_qfontForThemeFont(kThemeMenuItemFont));
fonts.insert(QPlatformTheme::MenuBarFont, qt_mac_qfontForThemeFont(kThemeMenuItemFont));
fonts.insert(QPlatformTheme::ComboMenuItemFont, qt_mac_qfontForThemeFont(kThemeSystemFont));
fonts.insert(QPlatformTheme::HeaderViewFont, qt_mac_qfontForThemeFont(kThemeSmallSystemFont));
fonts.insert(QPlatformTheme::TipLabelFont, qt_mac_qfontForThemeFont(kThemeSmallSystemFont));

View File

@ -2077,6 +2077,10 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
ret = 0;
break;
case PM_MenuBarPanelWidth:
ret = 0;
break;
case QStyle::PM_MenuDesktopFrameWidth:
ret = 5;
break;
@ -6259,6 +6263,10 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
sz = QSize(w, h);
}
break;
case CT_MenuBarItem:
if (!sz.isEmpty())
sz += QSize(12, 4); // Constants from QWindowsStyle
break;
case CT_ToolButton:
sz.rwidth() += 10;
sz.rheight() += 10;