diff --git a/src/dialogs/preferences/GeneralOptionsWidget.cpp b/src/dialogs/preferences/GeneralOptionsWidget.cpp index a81bb9d5..104287c1 100644 --- a/src/dialogs/preferences/GeneralOptionsWidget.cpp +++ b/src/dialogs/preferences/GeneralOptionsWidget.cpp @@ -35,7 +35,7 @@ void GeneralOptionsWidget::updateThemeFromConfig() // Disconnect currentIndexChanged because clearing the comboxBox and refiling it causes its index to change. disconnect(ui->colorComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(on_colorComboBox_currentIndexChanged(int))); - ui->themeComboBox->setCurrentIndex(Config()->getDarkTheme()); + ui->themeComboBox->setCurrentIndex(Config()->getTheme()); QList themes = Core()->getColorThemes(); ui->colorComboBox->clear(); @@ -71,7 +71,7 @@ void GeneralOptionsWidget::on_fontSelectionButton_clicked() void GeneralOptionsWidget::on_themeComboBox_currentIndexChanged(int index) { //disconnect(Config(), SIGNAL(colorsUpdated()), this, SLOT(updateThemeFromConfig())); - Config()->setDarkTheme(index); + Config()->setTheme(index); //connect(Config(), SIGNAL(colorsUpdated()), this, SLOT(updateThemeFromConfig())); } diff --git a/src/dialogs/preferences/GeneralOptionsWidget.ui b/src/dialogs/preferences/GeneralOptionsWidget.ui index a167bec1..368eb1f4 100644 --- a/src/dialogs/preferences/GeneralOptionsWidget.ui +++ b/src/dialogs/preferences/GeneralOptionsWidget.ui @@ -81,17 +81,12 @@ Dark - - - Dark Grey - - - Color theme + Color Theme diff --git a/src/utils/Configuration.cpp b/src/utils/Configuration.cpp index efa409cb..0a53829a 100644 --- a/src/utils/Configuration.cpp +++ b/src/utils/Configuration.cpp @@ -53,7 +53,7 @@ Configuration *Configuration::instance() void Configuration::loadInitial() { - setDarkTheme(getDarkTheme()); + setTheme(getTheme()); setColorTheme(getCurrentTheme()); applySavedAsmOptions(); } @@ -159,22 +159,7 @@ void Configuration::loadBaseDark() void Configuration::loadDarkTheme() { loadBaseDark(); - setColor("gui.border", QColor(255, 255, 255)); - // Windows background - setColor("gui.background", QColor(36, 66, 79)); - // Disassembly nodes background - setColor("gui.alt_background", QColor(58, 100, 128)); - // Disassembly nodes background when selected - setColor("gui.disass_selected", QColor(36, 66, 79)); - // Disassembly line selected - setColor("highlight", QColor(64, 115, 115)); - setColor("highlightWord", QColor(64, 115, 115)); -} - -void Configuration::loadDarkGreyTheme() -{ - loadBaseDark(); - setColor("gui.border", QColor(100,100,100)); + setColor("gui.border", QColor(100, 100, 100)); // Windows background setColor("gui.background", QColor(37, 40, 43)); // Disassembly nodes background @@ -198,16 +183,16 @@ void Configuration::setFont(const QFont &font) emit fontsUpdated(); } -void Configuration::setDarkTheme(int theme) +void Configuration::setTheme(int theme) { - s.setValue("dark", theme); + s.setValue("ColorPalette", theme); switch(theme){ + case 0: + loadDefaultTheme(); + break; case 1: loadDarkTheme(); break; - case 2: - loadDarkGreyTheme(); - break; default: loadDefaultTheme(); } diff --git a/src/utils/Configuration.h b/src/utils/Configuration.h index 95c32a7b..78623c2a 100644 --- a/src/utils/Configuration.h +++ b/src/utils/Configuration.h @@ -21,7 +21,6 @@ private: void loadBaseDark(); void loadDefaultTheme(); void loadDarkTheme(); - void loadDarkGreyTheme(); void setColor(const QString &name, const QColor &color); // Images @@ -43,10 +42,10 @@ public: // Colors const QColor getColor(const QString &name) const; - void setDarkTheme(int theme); - int getDarkTheme() + void setTheme(int theme); + int getTheme() { - return s.value("dark").toInt(); + return s.value("ColorPalette").toInt(); } QString getDirProjects();