Capitalize theme names

This commit is contained in:
RedBlackAka 2025-01-19 04:16:26 +00:00 committed by Adam Honse
parent 29e384af98
commit 6ac3fae951
2 changed files with 5 additions and 5 deletions

View file

@ -73,7 +73,7 @@ OpenRGBSettingsPage::OpenRGBSettingsPage(QWidget *parent) :
/*---------------------------------------------------------*\ /*---------------------------------------------------------*\
| Load theme settings | | Load theme settings |
\*---------------------------------------------------------*/ \*---------------------------------------------------------*/
ui->ComboBoxTheme->addItems({"auto", "light", "dark"}); ui->ComboBoxTheme->addItems({"Auto", "Light", "Dark"});
json theme_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("Theme"); json theme_settings = ResourceManager::get()->GetSettingsManager()->GetSettings("Theme");
@ -84,7 +84,7 @@ OpenRGBSettingsPage::OpenRGBSettingsPage(QWidget *parent) :
} }
else else
{ {
ui->ComboBoxTheme->setCurrentText(QString::fromStdString(("light"))); ui->ComboBoxTheme->setCurrentText(QString::fromStdString(("Light")));
} }
theme_initialized = true; theme_initialized = true;

View file

@ -93,19 +93,19 @@ bool OpenRGBThemeManager::IsDarkTheme()
/*-------------------------------------------------*\ /*-------------------------------------------------*\
| Read the theme key and adjust accordingly | | Read the theme key and adjust accordingly |
\*-------------------------------------------------*/ \*-------------------------------------------------*/
std::string current_theme = "light"; std::string current_theme = "Light";
if(theme_settings.contains("theme")) if(theme_settings.contains("theme"))
{ {
current_theme = theme_settings["theme"]; current_theme = theme_settings["theme"];
} }
if(current_theme == "dark") if(current_theme == "Dark")
{ {
return true; return true;
} }
#ifdef _WIN32 #ifdef _WIN32
else if(current_theme == "auto") else if(current_theme == "Auto")
{ {
QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", QSettings::NativeFormat); QSettings settings("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", QSettings::NativeFormat);