change is_system_theme_dark to is_system_theme_light
This commit is contained in:
+3
-3
@@ -28,10 +28,10 @@ impl From<Theme> for catppuccin_egui::Theme {
|
|||||||
fn from(val: Theme) -> Self {
|
fn from(val: Theme) -> Self {
|
||||||
match val {
|
match val {
|
||||||
Theme::Auto => {
|
Theme::Auto => {
|
||||||
if win::is_system_theme_dark() {
|
if win::is_system_theme_light() {
|
||||||
catppuccin_egui::MOCHA
|
|
||||||
} else {
|
|
||||||
catppuccin_egui::LATTE
|
catppuccin_egui::LATTE
|
||||||
|
} else {
|
||||||
|
catppuccin_egui::MOCHA
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Theme::CatppuccinLatte => catppuccin_egui::LATTE,
|
Theme::CatppuccinLatte => catppuccin_egui::LATTE,
|
||||||
|
|||||||
+5
-3
@@ -80,7 +80,7 @@ pub fn is_elevated() -> bool {
|
|||||||
result.is_ok() && elevation.TokenIsElevated != 0
|
result.is_ok() && elevation.TokenIsElevated != 0
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn is_system_theme_dark() -> bool {
|
pub fn is_system_theme_light() -> bool {
|
||||||
use winreg::RegKey;
|
use winreg::RegKey;
|
||||||
let hkcu = RegKey::predef(winreg::enums::HKEY_CURRENT_USER);
|
let hkcu = RegKey::predef(winreg::enums::HKEY_CURRENT_USER);
|
||||||
let Ok(subkey) =
|
let Ok(subkey) =
|
||||||
@@ -88,8 +88,10 @@ pub fn is_system_theme_dark() -> bool {
|
|||||||
else {
|
else {
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
let Ok(dword): Result<u32, std::io::Error> = subkey.get_value("AppsUseLightTheme") else {
|
let Ok(apps_use_light_theme): Result<u32, std::io::Error> =
|
||||||
|
subkey.get_value("AppsUseLightTheme")
|
||||||
|
else {
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
dword != 1
|
apps_use_light_theme == 1
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user