diff --git a/data/settings/org.hawaiios.desktop.interface.gschema.xml b/data/settings/org.hawaiios.desktop.interface.gschema.xml index c786146..b6fe386 100644 --- a/data/settings/org.hawaiios.desktop.interface.gschema.xml +++ b/data/settings/org.hawaiios.desktop.interface.gschema.xml @@ -95,6 +95,22 @@ Font size for applications. + + 'Droid Sans Mono' + Monospace Font Name + + Name of monospaced (fixed-width) font for use in locations + like terminals. + + + + 11 + Monospace Font Size + + Size of monospaced (fixed-width) font for use in locations + like terminals. + + 'Noto Sans' Small Font Family diff --git a/platformtheme/hawaiitheme_p.cpp b/platformtheme/hawaiitheme_p.cpp index bf476c4..39bf934 100644 --- a/platformtheme/hawaiitheme_p.cpp +++ b/platformtheme/hawaiitheme_p.cpp @@ -36,6 +36,8 @@ // Default fonts static const char defaultSystemFontName[] = "Droid Sans"; static int defaultSystemFontSize = 11; +static const char defaultMonospaceFontName[] = "Droid Sans Mono"; +static int defaultMonospaceFontSize = 11; HawaiiThemePrivate::HawaiiThemePrivate() { @@ -76,6 +78,8 @@ void HawaiiThemePrivate::refresh() // Fonts QString fontFamily = settings->value(QStringLiteral("fontName")).toString(); int fontSize = settings->value(QStringLiteral("fontSize")).toInt(); + QString monospaceFontFamily = settings->value(QStringLiteral("monospaceFontName")).toString(); + int monospaceFontSize = settings->value(QStringLiteral("monospaceFontSize")).toInt(); QString smallFontFamily = settings->value(QStringLiteral("smallFontName")).toString(); int smallFontSize = settings->value(QStringLiteral("smallFontSize")).toInt(); QString miniFontFamily = settings->value(QStringLiteral("miniFontName")).toString(); @@ -87,6 +91,12 @@ void HawaiiThemePrivate::refresh() else resources.fonts[QPlatformTheme::SystemFont] = new QFont(QLatin1String(defaultSystemFontName), defaultSystemFontSize); + // Monospace font + if (QFont *monospaceFont = readFont(monospaceFontFamily, monospaceFontSize)) + resources.fonts[QPlatformTheme::FixedFont] = monospaceFont; + else + resources.fonts[QPlatformTheme::FixedFont] = new QFont(QLatin1String(defaultMonospaceFontName), defaultMonospaceFontSize); + // Small font if (QFont *smallFont = readFont(smallFontFamily, smallFontSize)) resources.fonts[QPlatformTheme::SmallFont] = smallFont;