fix autoDark

This commit is contained in:
Tsuki 2023-04-01 20:44:17 +08:00
parent 881d694f77
commit 5f5bd7ec6a

View file

@ -1716,18 +1716,13 @@ namespace v2rayN.ViewModels
{ {
var theme = _paletteHelper.GetTheme(); var theme = _paletteHelper.GetTheme();
//add follow systemTheme //add follow systemTheme
var systemTheme = OSAppTheme.Light; var systemTheme = Windows.UI.Xaml.Application.Current.RequestedTheme;
if (Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Mobile"){ if (systemTheme == ApplicationTheme.Dark)
systemTheme = Application.Current.RequestedTheme; {
}
else{
systemTheme = Windows.UI.Xaml.Application.Current.RequestedTheme;
}
if (systemTheme == OSAppTheme.Dark){
isDarkTheme = true; isDarkTheme = true;
} }
else if (systemTheme == OSAppTheme.Light){ else if (systemTheme == ApplicationTheme.Light)
{
isDarkTheme = false; isDarkTheme = false;
} }