From 60ae6cfdfed5450dac9dd4209685a02b3391eb0f Mon Sep 17 00:00:00 2001 From: "Felix (xq) Queißner" Date: Sun, 21 Jun 2020 23:27:24 +0200 Subject: Fixes pre-selection of light theme --- src/settingsdialog.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/settingsdialog.cpp') diff --git a/src/settingsdialog.cpp b/src/settingsdialog.cpp index f2c6307..ebd1664 100644 --- a/src/settingsdialog.cpp +++ b/src/settingsdialog.cpp @@ -185,12 +185,13 @@ void SettingsDialog::setOptions(const GenericSettings &options) { this->current_options = options; - if(this->current_options.theme == Theme::light) - this->ui->ui_theme->setCurrentIndex(0); - else if(this->current_options.theme == Theme::dark) - this->ui->ui_theme->setCurrentIndex(1); - else - this->ui->ui_theme->setCurrentIndex(0); + this->ui->ui_theme->setCurrentIndex(0); + for(int i = 0; i < this->ui->ui_theme->count(); i++) { + if(this->ui->ui_theme->itemData(i).toInt() == int(options.theme)) { + this->ui->ui_theme->setCurrentIndex(i); + break; + } + } this->ui->start_page->setText(this->current_options.start_page); -- cgit v1.2.3