summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-08-12 13:05:02 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-08-12 13:05:02 +0200
commitca524e5b70ccfeb6386cf0c5df83ffb86a8771fe (patch)
tree245c471373516ccda2b0c91943a42cd74674f2da /src/plugins/platforms/cocoa/qcocoasystemsettings.mm
parentb08cc0ec6f096d0e6764486c81264c24a406bee1 (diff)
parentc2badc7423b63824902d1f44a4b804de3335c20b (diff)
Merge remote-tracking branch 'origin/5.3' into 5.4
Manually included changes from 3a347a4e70e5a10ee92dd2578316c926a399e894 in src/opengl/qgl.cpp. Conflicts: src/opengl/qgl_qpa.cpp src/plugins/platforms/android/androidjnimain.cpp Change-Id: Ic26b58ee587d4884c9d0fba45c5a94b5a45ee929
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoasystemsettings.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoasystemsettings.mm44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
index 26aa871998..3ce2f06763 100644
--- a/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
+++ b/src/plugins/platforms/cocoa/qcocoasystemsettings.mm
@@ -213,48 +213,4 @@ QHash<QPlatformTheme::Palette, QPalette*> qt_mac_createRolePalettes()
return palettes;
}
-QFont *qt_mac_qfontForThemeFont(ThemeFontID themeID)
-{
- CTFontUIFontType ctID = HIThemeGetUIFontType(themeID);
- QCFType<CTFontRef> ctfont = CTFontCreateUIFontForLanguage(ctID, 0, 0);
- QString familyName = QCFString(CTFontCopyFamilyName(ctfont));
- QCFType<CFDictionaryRef> dict = CTFontCopyTraits(ctfont);
- CFNumberRef num = static_cast<CFNumberRef>(CFDictionaryGetValue(dict, kCTFontWeightTrait));
- float fW;
- CFNumberGetValue(num, kCFNumberFloat32Type, &fW);
- QFont::Weight wght = fW > 0. ? QFont::Bold : QFont::Normal;
- num = static_cast<CFNumberRef>(CFDictionaryGetValue(dict, kCTFontSlantTrait));
- CFNumberGetValue(num, kCFNumberFloatType, &fW);
- bool italic = (fW != 0.0);
- return new QFont(familyName, CTFontGetSize(ctfont), wght, italic);
-}
-
-QHash<QPlatformTheme::Font, QFont *> qt_mac_createRoleFonts()
-{
- QHash<QPlatformTheme::Font, QFont *> fonts;
-
- fonts.insert(QPlatformTheme::SystemFont, qt_mac_qfontForThemeFont(kThemeApplicationFont));
- fonts.insert(QPlatformTheme::PushButtonFont, qt_mac_qfontForThemeFont(kThemePushButtonFont));
- fonts.insert(QPlatformTheme::ListViewFont, qt_mac_qfontForThemeFont(kThemeViewsFont));
- 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));
- fonts.insert(QPlatformTheme::LabelFont, qt_mac_qfontForThemeFont(kThemeSystemFont));
- fonts.insert(QPlatformTheme::ToolButtonFont, qt_mac_qfontForThemeFont(kThemeSmallSystemFont));
- fonts.insert(QPlatformTheme::MenuItemFont, qt_mac_qfontForThemeFont(kThemeMenuItemFont));
- fonts.insert(QPlatformTheme::ComboLineEditFont, qt_mac_qfontForThemeFont(kThemeViewsFont));
- fonts.insert(QPlatformTheme::SmallFont, qt_mac_qfontForThemeFont(kThemeSmallSystemFont));
- fonts.insert(QPlatformTheme::MiniFont, qt_mac_qfontForThemeFont(kThemeMiniSystemFont));
-
- QFont* fixedFont = new QFont(QStringLiteral("Monaco"), fonts[QPlatformTheme::SystemFont]->pointSize());
- fixedFont->setStyleHint(QFont::TypeWriter);
- fonts.insert(QPlatformTheme::FixedFont, fixedFont);
-
- return fonts;
-}
-
QT_END_NAMESPACE