mirror of
https://github.com/2dust/v2rayN.git
synced 2025-08-29 22:36:20 +00:00
Simplify and improve Darkmode
This commit is contained in:
parent
f6e82bb81b
commit
c1c4d8752c
1 changed files with 5 additions and 2 deletions
|
@ -1714,8 +1714,11 @@ namespace v2rayN.ViewModels
|
||||||
|
|
||||||
public void ModifyTheme(out bool isDarkTheme)
|
public void ModifyTheme(out bool isDarkTheme)
|
||||||
{
|
{
|
||||||
var currentTheme = SystemParameters.HighContrast ? Theme.Dark : Theme.Light;
|
var currentTheme = Application.Current.Resources.MergedDictionaries
|
||||||
isDarkTheme = currentTheme == Theme.Dark;
|
.OfType<Theme>()
|
||||||
|
.FirstOrDefault()?
|
||||||
|
.BaseColorScheme == ThemeManager.BaseColorScheme.Dark;
|
||||||
|
isDarkTheme = currentTheme.HasValue && currentTheme.Value;
|
||||||
|
|
||||||
var window = Application.Current.MainWindow;
|
var window = Application.Current.MainWindow;
|
||||||
var windowChrome = WindowChrome.GetWindowChrome(window);
|
var windowChrome = WindowChrome.GetWindowChrome(window);
|
||||||
|
|
Loading…
Reference in a new issue