Skip to content

Commit ad1e323

Browse files
authored
Improved support for HighContrast themes (#2126)
1 parent 63cdc33 commit ad1e323

File tree

10 files changed

+213
-140
lines changed

10 files changed

+213
-140
lines changed

Files/App.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
<SolidColorBrush x:Key="CloudDriveSyncStatusOnlineColor" Color="#0078D7" />
3131
<SolidColorBrush x:Key="CloudDriveSyncStatusOfflineColor" Color="#30BB03" />
3232
<SolidColorBrush x:Key="CloudDriveSyncStatusExcludedColor" Color="#AAAAAA" />
33-
<SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="#201F1E" />
34-
<SolidColorBrush x:Key="SystemControlPageBackgroundMediumAltMediumBrush" Color="#99000000" />
33+
<SolidColorBrush x:Key="ApplicationPageBackgroundThemeBrush" Color="{ThemeResource SystemColorWindowColor}" />
34+
<SolidColorBrush x:Key="SystemControlPageBackgroundMediumAltMediumBrush" Color="{ThemeResource SystemColorWindowColor}" />
3535
</ResourceDictionary>
3636
</ResourceDictionary.ThemeDictionaries>
3737
</ResourceDictionary>

Files/ResourceDictionaries/TabView_themeresources.xaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
<ResourceDictionary.ThemeDictionaries>
88
<ResourceDictionary x:Key="Light">
99
<StaticResource x:Key="TabViewBackground" ResourceKey="SystemControlBackgroundListLowBrush" />
10-
<Color x:Key="TabViewBackgroundFixed">#FFF3F2F1</Color>
1110
<StaticResource x:Key="TabViewItemHeaderBackground" ResourceKey="SystemControlTransparentBrush" />
1211
<StaticResource x:Key="TabViewItemHeaderBackgroundSelected" ResourceKey="ApplicationPageBackgroundThemeBrush" />
1312
<StaticResource x:Key="TabViewItemHeaderBackgroundPointerOver" ResourceKey="SystemAltMediumLowColor" />
@@ -55,7 +54,6 @@
5554

5655
<ResourceDictionary x:Key="Dark">
5756
<StaticResource x:Key="TabViewBackground" ResourceKey="SystemControlBackgroundBaseLowBrush" />
58-
<Color x:Key="TabViewBackgroundFixed">#161514</Color>
5957
<StaticResource x:Key="TabViewItemHeaderBackground" ResourceKey="SystemControlTransparentBrush" />
6058
<Color x:Key="TabViewItemHeaderBackgroundSelected">#292827</Color>
6159
<StaticResource x:Key="TabViewItemHeaderBackgroundPointerOver" ResourceKey="SystemAltMediumLowColor" />

Files/UserControls/ModernNavigationToolbar.xaml

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@
1818
mc:Ignorable="d">
1919
<UserControl.Resources>
2020
<ResourceDictionary>
21+
<ResourceDictionary.ThemeDictionaries>
22+
<ResourceDictionary x:Key="Light">
23+
<SolidColorBrush x:Key="PathBoxHoverBrush" Color="{StaticResource SystemRevealListLowColor}" />
24+
</ResourceDictionary>
25+
<ResourceDictionary x:Key="Dark">
26+
<SolidColorBrush x:Key="PathBoxHoverBrush" Color="{StaticResource SystemRevealListLowColor}" />
27+
</ResourceDictionary>
28+
<ResourceDictionary x:Key="HighContrast">
29+
<SolidColorBrush x:Key="PathBoxHoverBrush" Color="{ThemeResource SystemColorWindowColor}" />
30+
</ResourceDictionary>
31+
</ResourceDictionary.ThemeDictionaries>
2132
<ResourceDictionary.MergedDictionaries>
2233
<ResourceDictionary Source="/ResourceDictionaries/ToolbarButtonStyle.xaml" />
2334

@@ -623,7 +634,9 @@
623634
TargetTheme="Dark"
624635
Color="Transparent" />
625636
</ResourceDictionary>
626-
<ResourceDictionary x:Key="HighContrast" />
637+
<ResourceDictionary x:Key="HighContrast">
638+
<SolidColorBrush x:Key="TransparentGridRevealBorderBrush" Color="{ThemeResource SystemColorWindowTextColor}" />
639+
</ResourceDictionary>
627640
</ResourceDictionary.ThemeDictionaries>
628641
</ResourceDictionary>
629642
</ResourceDictionary.MergedDictionaries>
@@ -787,11 +800,7 @@
787800
PointerPressed="ManualPathEntryItem_Click">
788801
<Interactivity:Interaction.Behaviors>
789802
<Core:EventTriggerBehavior EventName="PointerEntered">
790-
<Core:ChangePropertyAction PropertyName="Background">
791-
<Core:ChangePropertyAction.Value>
792-
<SolidColorBrush Color="{ThemeResource SystemRevealListLowColor}" />
793-
</Core:ChangePropertyAction.Value>
794-
</Core:ChangePropertyAction>
803+
<Core:ChangePropertyAction PropertyName="Background" Value="{ThemeResource PathBoxHoverBrush}" />
795804
</Core:EventTriggerBehavior>
796805

797806
<Core:EventTriggerBehavior EventName="PointerExited">

Files/UserControls/MultitaskingControl/HorizontalMultitaskingControl.xaml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
55
xmlns:Windows10version1903="http://schemas.microsoft.com/winfx/2006/xaml/presentation?IsApiContractPresent(Windows.Foundation.UniversalApiContract, 8)"
6+
xmlns:converters="using:Files.Converters"
67
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
78
xmlns:local="using:Files.UserControls"
89
xmlns:local1="using:Files"
@@ -733,14 +734,32 @@
733734
</Style>
734735
</ResourceDictionary>
735736
<ResourceDictionary>
736-
<AcrylicBrush
737-
x:Key="TabViewBackground"
738-
Windows10version1903:TintLuminosityOpacity="0.75"
739-
AlwaysUseFallback="{x:Bind AppSettings.AcrylicEnabled, Mode=OneWay}"
740-
BackgroundSource="HostBackdrop"
741-
FallbackColor="{ThemeResource TabViewBackgroundFixed}"
742-
TintColor="{x:Bind AppSettings.AcrylicTheme.TintColor, Mode=OneWay}"
743-
TintOpacity="0.5" />
737+
<ResourceDictionary.ThemeDictionaries>
738+
<ResourceDictionary x:Key="Light">
739+
<AcrylicBrush
740+
x:Key="TabViewBackground"
741+
Windows10version1903:TintLuminosityOpacity="0.75"
742+
AlwaysUseFallback="{x:Bind AppSettings.AcrylicEnabled, Mode=OneWay}"
743+
BackgroundSource="HostBackdrop"
744+
FallbackColor="#FFF3F2F1"
745+
TintColor="{x:Bind AppSettings.AcrylicTheme.TintColor, Mode=OneWay}"
746+
TintOpacity="0.5" />
747+
</ResourceDictionary>
748+
<ResourceDictionary x:Key="Dark">
749+
<AcrylicBrush
750+
x:Key="TabViewBackground"
751+
Windows10version1903:TintLuminosityOpacity="0.75"
752+
AlwaysUseFallback="{x:Bind AppSettings.AcrylicEnabled, Mode=OneWay}"
753+
BackgroundSource="HostBackdrop"
754+
FallbackColor="#161514"
755+
TintColor="{x:Bind AppSettings.AcrylicTheme.TintColor, Mode=OneWay}"
756+
TintOpacity="0.5" />
757+
</ResourceDictionary>
758+
<ResourceDictionary x:Key="HighContrast">
759+
<SolidColorBrush x:Key="TabViewBackground" Color="{ThemeResource SystemColorActiveCaptionColor}" />
760+
</ResourceDictionary>
761+
</ResourceDictionary.ThemeDictionaries>
762+
744763
</ResourceDictionary>
745764
</ResourceDictionary.MergedDictionaries>
746765
</ResourceDictionary>

0 commit comments

Comments
 (0)