summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorredsky17 <joedonofry@gmail.com>2019-01-19 17:31:17 +0000
committerredsky17 <joedonofry@gmail.com>2019-01-19 17:31:17 +0000
commit98102f4f092d3e47f98dd81d978932a3838e19fe (patch)
tree93776d56051142d00c5f03b075eb2273978387e3 /src
parentAdd User Font Setting (diff)
downloadnheko-98102f4f092d3e47f98dd81d978932a3838e19fe.tar.xz
Fix UserSettings UI not showing saved prefs
Theme and Font Family settings will now correctly display the stored
settings when nheko is re-launched.  Previously, these combo boxes
would default to the first thing in the combo box, even if that
wasn't what the user selected.
Diffstat (limited to 'src')
-rw-r--r--src/UserSettingsPage.cpp8
-rw-r--r--src/UserSettingsPage.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/src/UserSettingsPage.cpp b/src/UserSettingsPage.cpp

index 194a32e1..fdb67080 100644 --- a/src/UserSettingsPage.cpp +++ b/src/UserSettingsPage.cpp
@@ -239,6 +239,9 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge fontSelectionCombo_->addItem(family); } + int fontIndex = fontSelectionCombo_->findText(settings_->font()); + fontSelectionCombo_->setCurrentIndex(fontIndex); + fontFamilyOptionLayout->addWidget(fontFamilyLabel); fontFamilyOptionLayout->addWidget(fontSelectionCombo_, 0, Qt::AlignRight); @@ -251,6 +254,11 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge themeCombo_->addItem("Dark"); themeCombo_->addItem("System"); + QString themeStr = settings_->theme(); + themeStr.replace(0, 1, themeStr[0].toUpper()); + int themeIndex = themeCombo_->findText(themeStr); + themeCombo_->setCurrentIndex(themeIndex); + themeOptionLayout_->addWidget(themeLabel_); themeOptionLayout_->addWidget(themeCombo_, 0, Qt::AlignRight); diff --git a/src/UserSettingsPage.h b/src/UserSettingsPage.h
index 196ba844..94fb816f 100644 --- a/src/UserSettingsPage.h +++ b/src/UserSettingsPage.h
@@ -92,6 +92,7 @@ public: bool isReadReceiptsEnabled() const { return isReadReceiptsEnabled_; } bool hasDesktopNotifications() const { return hasDesktopNotifications_; } double fontSize() const { return baseFontSize_; } + QString font() const { return font_; } signals: void groupViewStateChanged(bool state);