diff options
author | sr55 <[email protected]> | 2021-02-06 21:43:52 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2021-02-06 21:43:52 +0000 |
commit | c9d2ec008746907551943dcbc8831f08da6e65f3 (patch) | |
tree | 51d23277f50870f53bc7c1dfb1e81d24447b5cb5 /win/CS/HandBrakeWPF/App.xaml.cs | |
parent | 52949b75fa06a0307ef4c7cc8af1c726100738b7 (diff) |
WinGui: Minor improvement to the light theme.
Diffstat (limited to 'win/CS/HandBrakeWPF/App.xaml.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/App.xaml.cs | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/win/CS/HandBrakeWPF/App.xaml.cs b/win/CS/HandBrakeWPF/App.xaml.cs index bbca2024e..23d6817c9 100644 --- a/win/CS/HandBrakeWPF/App.xaml.cs +++ b/win/CS/HandBrakeWPF/App.xaml.cs @@ -124,20 +124,34 @@ namespace HandBrakeWPF DarkThemeMode useDarkTheme = (DarkThemeMode)userSettingService.GetUserSetting<int>(UserSettingConstants.DarkThemeMode);
if (SystemInfo.IsWindows10())
{
- ResourceDictionary darkTheme = new ResourceDictionary();
+ ResourceDictionary theme = new ResourceDictionary();
switch (useDarkTheme)
{
case DarkThemeMode.System:
if (SystemInfo.IsAppsUsingDarkTheme())
{
- darkTheme.Source = new Uri("Themes/Dark.xaml", UriKind.Relative);
- Application.Current.Resources.MergedDictionaries.Add(darkTheme);
+ theme.Source = new Uri("Themes/Dark.xaml", UriKind.Relative);
+ Application.Current.Resources.MergedDictionaries.Add(theme);
+ }
+ else if (!SystemParameters.HighContrast)
+ {
+ theme.Source = new Uri("Themes/Light.xaml", UriKind.Relative);
+ Application.Current.Resources.MergedDictionaries.Add(theme);
}
break;
case DarkThemeMode.Dark:
- darkTheme.Source = new Uri("Themes/Dark.xaml", UriKind.Relative);
- Application.Current.Resources.MergedDictionaries.Add(darkTheme);
+ theme.Source = new Uri("Themes/Dark.xaml", UriKind.Relative);
+ Application.Current.Resources.MergedDictionaries.Add(theme);
break;
+ case DarkThemeMode.Light:
+ if (!SystemParameters.HighContrast)
+ {
+ theme.Source = new Uri("Themes/Light.xaml", UriKind.Relative);
+ Application.Current.Resources.MergedDictionaries.Add(theme);
+ }
+
+ break;
+
default:
break;
}
|