Commit 1b21b597 authored by Fabian Vogt's avatar Fabian Vogt

Also specify a default StyleName for fonts

Summary:
When saving, kcm_fonts adds the default selected StyleName,
so it needs to specified here as well to avoid mismatches.

BUG: 383191

Test Plan:
Ran pkcon install with no kdeglobals.
Without this change: Bold title in the auth dialog
With this change:  Normal title in the auth dialog

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D7160
parent b0059b1c
......@@ -53,13 +53,13 @@ static const char GeneralId[] = "General";
static const char DefaultFont[] = "Noto Sans";
static const KFontData DefaultFontData[KFontSettingsData::FontTypesCount] = {
{ GeneralId, "font", DefaultFont, 10, -1, QFont::SansSerif },
{ GeneralId, "fixed", "Hack", 9, -1, QFont::Monospace },
{ GeneralId, "toolBarFont", DefaultFont, 9, -1, QFont::SansSerif },
{ GeneralId, "menuFont", DefaultFont, 10, -1, QFont::SansSerif },
{ "WM", "activeFont", DefaultFont, 10, -1, QFont::SansSerif },
{ GeneralId, "taskbarFont", DefaultFont, 10, -1, QFont::SansSerif },
{ GeneralId, "smallestReadableFont", DefaultFont, 8, -1, QFont::SansSerif }
{ GeneralId, "font", DefaultFont, 10, -1, QFont::SansSerif, "Regular" },
{ GeneralId, "fixed", "Hack", 9, -1, QFont::Monospace, "Regular" },
{ GeneralId, "toolBarFont", DefaultFont, 9, -1, QFont::SansSerif, "Regular" },
{ GeneralId, "menuFont", DefaultFont, 10, -1, QFont::SansSerif, "Regular" },
{ "WM", "activeFont", DefaultFont, 10, -1, QFont::SansSerif, "Regular" },
{ GeneralId, "taskbarFont", DefaultFont, 10, -1, QFont::SansSerif, "Regular" },
{ GeneralId, "smallestReadableFont", DefaultFont, 8, -1, QFont::SansSerif, "Regular" }
};
QFont *KFontSettingsData::font(FontTypes fontType)
......@@ -70,6 +70,7 @@ QFont *KFontSettingsData::font(FontTypes fontType)
const KFontData &fontData = DefaultFontData[fontType];
cachedFont = new QFont(QLatin1String(fontData.FontName), fontData.Size, fontData.Weight);
cachedFont->setStyleHint(fontData.StyleHint);
cachedFont->setStyleName(QLatin1String(fontData.StyleName));
const KConfigGroup configGroup(mKdeGlobals, fontData.ConfigGroupKey);
QString fontInfo = configGroup.readEntry(fontData.ConfigKey, QString());
......
......@@ -32,6 +32,7 @@ struct KFontData {
int Size;
int Weight;
QFont::StyleHint StyleHint;
const char *StyleName;
};
class KFontSettingsData : public QObject
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment