mirror of
https://github.com/2dust/v2rayN.git
synced 2025-08-29 22:36:20 +00:00
add auto darkmode
This commit is contained in:
parent
5bef6b0492
commit
881d694f77
1 changed files with 10 additions and 3 deletions
|
@ -1716,11 +1716,18 @@ namespace v2rayN.ViewModels
|
||||||
{
|
{
|
||||||
var theme = _paletteHelper.GetTheme();
|
var theme = _paletteHelper.GetTheme();
|
||||||
//add follow systemTheme
|
//add follow systemTheme
|
||||||
var systemTheme = App.Current.RequestedTheme;
|
var systemTheme = OSAppTheme.Light;
|
||||||
if (systemTheme == AppTheme.Dark){
|
if (Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Mobile"){
|
||||||
|
systemTheme = Application.Current.RequestedTheme;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
systemTheme = Windows.UI.Xaml.Application.Current.RequestedTheme;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (systemTheme == OSAppTheme.Dark){
|
||||||
isDarkTheme = true;
|
isDarkTheme = true;
|
||||||
}
|
}
|
||||||
else if (systemTheme == AppTheme.Light){
|
else if (systemTheme == OSAppTheme.Light){
|
||||||
isDarkTheme = false;
|
isDarkTheme = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue