Light/Dark mode override

This commit is contained in:
IceStormNG
2023-08-18 18:36:34 +02:00
parent e2596ed9cb
commit 4952675749

View File

@@ -62,6 +62,16 @@ namespace GHelper.UI
private static bool IsDarkTheme() private static bool IsDarkTheme()
{ {
if (AppConfig.GetString("ui_mode").ToLower() == "dark")
{
return true;
}
if (AppConfig.GetString("ui_mode").ToLower() == "light")
{
return false;
}
using var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"); using var key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize");
var registryValueObject = key?.GetValue("AppsUseLightTheme"); var registryValueObject = key?.GetValue("AppsUseLightTheme");