Use modernized names for cocoa fonts

Old names have been deprecated
This commit is contained in:
Kovid Goyal 2018-12-24 11:05:51 +05:30
parent 5b3b05a943
commit d10d7371ce
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -716,71 +716,71 @@ static CTFontUIFontType fontTypeFromTheme(QPlatformTheme::Font f)
{ {
switch (f) { switch (f) {
case QPlatformTheme::SystemFont: case QPlatformTheme::SystemFont:
return kCTFontSystemFontType; return kCTFontUIFontSystem;
case QPlatformTheme::MenuFont: case QPlatformTheme::MenuFont:
case QPlatformTheme::MenuBarFont: case QPlatformTheme::MenuBarFont:
case QPlatformTheme::MenuItemFont: case QPlatformTheme::MenuItemFont:
return kCTFontMenuItemFontType; return kCTFontUIFontMenuItem;
case QPlatformTheme::MessageBoxFont: case QPlatformTheme::MessageBoxFont:
return kCTFontEmphasizedSystemFontType; return kCTFontUIFontEmphasizedSystem;
case QPlatformTheme::LabelFont: case QPlatformTheme::LabelFont:
return kCTFontSystemFontType; return kCTFontUIFontSystem;
case QPlatformTheme::TipLabelFont: case QPlatformTheme::TipLabelFont:
return kCTFontToolTipFontType; return kCTFontToolTipFontType;
case QPlatformTheme::StatusBarFont: case QPlatformTheme::StatusBarFont:
return kCTFontSystemFontType; return kCTFontUIFontSystem;
case QPlatformTheme::TitleBarFont: case QPlatformTheme::TitleBarFont:
return kCTFontWindowTitleFontType; return kCTFontUIFontWindowTitle;
case QPlatformTheme::MdiSubWindowTitleFont: case QPlatformTheme::MdiSubWindowTitleFont:
case QPlatformTheme::DockWidgetTitleFont: case QPlatformTheme::DockWidgetTitleFont:
return kCTFontSystemFontType; return kCTFontUIFontSystem;
case QPlatformTheme::PushButtonFont: case QPlatformTheme::PushButtonFont:
return kCTFontPushButtonFontType; return kCTFontUIFontPushButton;
case QPlatformTheme::CheckBoxFont: case QPlatformTheme::CheckBoxFont:
case QPlatformTheme::RadioButtonFont: case QPlatformTheme::RadioButtonFont:
return kCTFontSystemFontType; return kCTFontUIFontSystem;
case QPlatformTheme::ToolButtonFont: case QPlatformTheme::ToolButtonFont:
return kCTFontSmallToolbarFontType; return kCTFontUIFontSmallToolbar;
case QPlatformTheme::ItemViewFont: case QPlatformTheme::ItemViewFont:
return kCTFontSystemFontType; return kCTFontUIFontSystem;
case QPlatformTheme::ListViewFont: case QPlatformTheme::ListViewFont:
return kCTFontViewsFontType; return kCTFontUIFontViews;
case QPlatformTheme::HeaderViewFont: case QPlatformTheme::HeaderViewFont:
return kCTFontSmallSystemFontType; return kCTFontUIFontSmallSystem;
case QPlatformTheme::ListBoxFont: case QPlatformTheme::ListBoxFont:
return kCTFontViewsFontType; return kCTFontUIFontViews;
case QPlatformTheme::ComboMenuItemFont: case QPlatformTheme::ComboMenuItemFont:
return kCTFontSystemFontType; return kCTFontUIFontSystem;
case QPlatformTheme::ComboLineEditFont: case QPlatformTheme::ComboLineEditFont:
return kCTFontViewsFontType; return kCTFontUIFontViews;
case QPlatformTheme::SmallFont: case QPlatformTheme::SmallFont:
return kCTFontSmallSystemFontType; return kCTFontUIFontSmallSystem;
case QPlatformTheme::MiniFont: case QPlatformTheme::MiniFont:
return kCTFontMiniSystemFontType; return kCTFontUIFontMiniSystem;
case QPlatformTheme::FixedFont: case QPlatformTheme::FixedFont:
return kCTFontUserFixedPitchFontType; return kCTFontUIFontUserFixedPitch;
default: default:
return kCTFontSystemFontType; return kCTFontUIFontSystem;
} }
} }
@ -858,7 +858,7 @@ QFont *QCoreTextFontDatabase::themeFont(QPlatformTheme::Font f) const
QFont QCoreTextFontDatabase::defaultFont() const QFont QCoreTextFontDatabase::defaultFont() const
{ {
if (defaultFontName.isEmpty()) { if (defaultFontName.isEmpty()) {
QCFType<CTFontRef> font = CTFontCreateUIFontForLanguage(kCTFontSystemFontType, 12.0, NULL); QCFType<CTFontRef> font = CTFontCreateUIFontForLanguage(kCTFontUIFontSystem, 12.0, NULL);
defaultFontName = (QString) QCFString(CTFontCopyFullName(font)); defaultFontName = (QString) QCFString(CTFontCopyFullName(font));
} }