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.
This commit is contained in:
parent
654b652db4
commit
98102f4f09
2 changed files with 9 additions and 0 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue