File tree Expand file tree Collapse file tree 2 files changed +15
-4
lines changed
Expand file tree Collapse file tree 2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,12 @@ OpenRGBSettingsPage::OpenRGBSettingsPage(QWidget *parent) :
2323 std::string theme = theme_settings[" theme" ];
2424 ui->ComboBoxTheme ->setCurrentText (QString::fromStdString (theme));
2525 }
26+ else
27+ {
28+ ui->ComboBoxTheme ->setCurrentText (QString::fromStdString ((" light" )));
29+ }
30+
31+ theme_initialized = true ;
2632#else
2733 ui->ComboBoxTheme ->hide ();
2834 ui->ThemeLabel ->hide ();
@@ -59,10 +65,13 @@ OpenRGBSettingsPage::~OpenRGBSettingsPage()
5965
6066void OpenRGBSettingsPage::on_ComboBoxTheme_currentTextChanged (const QString theme)
6167{
62- json theme_settings = ResourceManager::get ()->GetSettingsManager ()->GetSettings (" Theme" );
63- theme_settings[" theme" ] = theme.toStdString ();
64- ResourceManager::get ()->GetSettingsManager ()->SetSettings (" Theme" , theme_settings);
65- SaveSettings ();
68+ if (theme_initialized)
69+ {
70+ json theme_settings = ResourceManager::get ()->GetSettingsManager ()->GetSettings (" Theme" );
71+ theme_settings[" theme" ] = theme.toStdString ();
72+ ResourceManager::get ()->GetSettingsManager ()->SetSettings (" Theme" , theme_settings);
73+ SaveSettings ();
74+ }
6675}
6776
6877void OpenRGBSettingsPage::on_CheckboxMinimizeOnClose_clicked ()
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ class Ui::OpenRGBSettingsPage : public QWidget
2020 Ui::OpenRGBSettingsPageUi *ui;
2121 void SaveSettings ();
2222
23+ bool theme_initialized = false ;
24+
2325private slots:
2426 void on_ComboBoxTheme_currentTextChanged (const QString);
2527 void on_CheckboxMinimizeOnClose_clicked ();
You can’t perform that action at this time.
0 commit comments