improve:UI

This commit is contained in:
2026-05-01 09:31:10 +08:00
parent e5ef1c6472
commit 97dbedfed5
2 changed files with 16 additions and 2 deletions
@@ -141,13 +141,27 @@ namespace Ink_Canvas.Windows.SettingsViews
{
0 => iNKORE.UI.WPF.Modern.ElementTheme.Light,
1 => iNKORE.UI.WPF.Modern.ElementTheme.Dark,
_ => iNKORE.UI.WPF.Modern.ElementTheme.Default,
_ => IsSystemThemeLight() ? iNKORE.UI.WPF.Modern.ElementTheme.Light : iNKORE.UI.WPF.Modern.ElementTheme.Dark,
};
iNKORE.UI.WPF.Modern.ThemeManager.SetRequestedTheme(this, elementTheme);
}
catch { }
}
private static bool IsSystemThemeLight()
{
try
{
using (var themeKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(
@"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"))
{
if (themeKey?.GetValue("SystemUsesLightTheme") is int v) return v == 1;
}
}
catch { }
return false;
}
#region
[System.Runtime.InteropServices.DllImport("user32.dll")]