diff options
-rw-r--r-- | qt-ui/mainwindow.cpp | 3 | ||||
-rw-r--r-- | qt-ui/preferences.cpp | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index f4f97f92d..36fa71d73 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -677,6 +677,9 @@ void MainWindow::readSettings() s.endGroup(); s.beginGroup("Display"); + QFont defaultFont = s.value("divelist_font", qApp->font()).value<QFont>(); + defaultFont.setPointSizeF(s.value("font_size", qApp->font().pointSizeF()).toFloat()); + qApp->setFont(defaultFont); GET_TXT("divelist_font", divelist_font); GET_INT("font_size", font_size); GET_INT("displayinvalid", display_invalid_dives); diff --git a/qt-ui/preferences.cpp b/qt-ui/preferences.cpp index 91a34a6ba..382880a1f 100644 --- a/qt-ui/preferences.cpp +++ b/qt-ui/preferences.cpp @@ -93,7 +93,7 @@ void PreferencesDialog::setUiFromPrefs() ui.kg->setChecked(prefs.units.weight == units::KG); ui.lbs->setChecked(prefs.units.weight == units::LBS); - ui.font->setFont(QString(prefs.divelist_font)); + ui.font->setCurrentFont(QString(prefs.divelist_font)); ui.fontsize->setValue(prefs.font_size); ui.defaultfilename->setText(prefs.default_filename); ui.default_cylinder->clear(); @@ -182,7 +182,7 @@ void PreferencesDialog::syncSettings() s.endGroup(); s.beginGroup("Display"); - s.setValue("divelist_font", ui.font->font().family()); + s.setValue("divelist_font", ui.font->currentFont()); s.setValue("font_size", ui.fontsize->value()); s.setValue("displayinvalid", ui.displayinvalid->isChecked()); s.endGroup(); |