Add User Font Setting

User can now select a font from the installed fonts on their system

This font currently will only be applied when nheko is restarted
(similar to how font size and scaling currently work).  This will
be addressed in a future commit.  Additionally, the dropdown
does not correctly select the previously-chosen user font, and
instead defaults to the first font available on the system
(alphabetically).  This is similar to the issue with the 'Theme'
combo defaulting to 'Light' even when another theme is selected.
This commit is contained in:
redsky17 2019-01-19 16:20:41 +00:00
parent 50e382f554
commit 654b652db4
3 changed files with 35 additions and 2 deletions

View file

@ -147,6 +147,10 @@ main(int argc, char *argv[])
QSettings settings;
QFont font;
QString userFontFamily = settings.value("user/font_family", "").toString();
if (!userFontFamily.isEmpty()) {
font.setFamily(userFontFamily);
}
font.setPointSizeF(settings.value("user/font_size", font.pointSizeF()).toDouble());
app.setFont(font);