From e89c3acc0656990e96d15095d6c030c3c60d817b Mon Sep 17 00:00:00 2001 From: futile Date: Thu, 20 Nov 2025 14:10:26 +0000 Subject: [PATCH] change `is_system_theme_dark` to `is_system_theme_light` --- src/gui/settings.rs | 6 +++--- src/util/win.rs | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gui/settings.rs b/src/gui/settings.rs index 3c5e98c..81ed5e1 100644 --- a/src/gui/settings.rs +++ b/src/gui/settings.rs @@ -28,10 +28,10 @@ impl From for catppuccin_egui::Theme { fn from(val: Theme) -> Self { match val { Theme::Auto => { - if win::is_system_theme_dark() { - catppuccin_egui::MOCHA - } else { + if win::is_system_theme_light() { catppuccin_egui::LATTE + } else { + catppuccin_egui::MOCHA } } Theme::CatppuccinLatte => catppuccin_egui::LATTE, diff --git a/src/util/win.rs b/src/util/win.rs index 5408d0d..7826d36 100644 --- a/src/util/win.rs +++ b/src/util/win.rs @@ -80,7 +80,7 @@ pub fn is_elevated() -> bool { result.is_ok() && elevation.TokenIsElevated != 0 } -pub fn is_system_theme_dark() -> bool { +pub fn is_system_theme_light() -> bool { use winreg::RegKey; let hkcu = RegKey::predef(winreg::enums::HKEY_CURRENT_USER); let Ok(subkey) = @@ -88,8 +88,10 @@ pub fn is_system_theme_dark() -> bool { else { return true; }; - let Ok(dword): Result = subkey.get_value("AppsUseLightTheme") else { + let Ok(apps_use_light_theme): Result = + subkey.get_value("AppsUseLightTheme") + else { return true; }; - dword != 1 + apps_use_light_theme == 1 }