Skip to content

Commit eb93169

Browse files
Merged all the high contrast themes files into one theme file (#9351)
* Merging all the high contrast theme files into one file * Removing unnessary comments
1 parent ebf5927 commit eb93169

File tree

5 files changed

+24
-2128
lines changed

5 files changed

+24
-2128
lines changed

src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/ThemeManager.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,13 +226,7 @@ private static Uri GetFluentWindowThemeColorResourceUri(string systemTheme, bool
226226

227227
if(SystemParameters.HighContrast)
228228
{
229-
themeColorFileName = systemTheme switch
230-
{
231-
string s when s.Contains("hcblack") => "hcblack.xaml",
232-
string s when s.Contains("hcwhite") => "hcwhite.xaml",
233-
string s when s.Contains("hc1") => "hc1.xaml",
234-
_ => "hc2.xaml"
235-
};
229+
themeColorFileName = "hc.xaml";
236230
}
237231

238232
return new Uri("pack://application:,,,/PresentationFramework.Fluent;component/Resources/Theme/" + themeColorFileName, UriKind.Absolute);
Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,23 @@
2121
<Color x:Key="SystemAccentColorSecondary">#4cc2ff</Color>
2222
<Color x:Key="SystemAccentColorTertiary">#4cc2ff</Color>
2323

24-
<!-- Highcontrast theme: DUSK. -->
25-
<Color x:Key="SystemColorWindowTextColor">#FFFFFF</Color>
26-
<Color x:Key="SystemColorWindowColor">#2D3236</Color>
27-
<Color x:Key="SystemColorHighlightTextColor">#212D3B</Color>
28-
<Color x:Key="SystemColorHighlightColor">#ABCFF2</Color>
29-
<Color x:Key="SystemColorButtonTextColor">#B6F6F0</Color>
30-
<Color x:Key="SystemColorButtonFaceColor">#2D3236</Color>
31-
<Color x:Key="SystemColorHotlightColor">#70EBDE</Color>
32-
<Color x:Key="SystemColorGrayTextColor">#A6A6A6</Color>
33-
24+
<!-- Highcontrast theme -->
25+
<DynamicResource x:Key="SystemColorWindowTextColor" ResourceKey="{x:Static SystemColors.WindowTextColorKey}" />
26+
<DynamicResource x:Key="SystemColorWindowColor" ResourceKey="{x:Static SystemColors.WindowColorKey}" />
27+
<DynamicResource x:Key="SystemColorHighlightTextColor" ResourceKey="{x:Static SystemColors.HighlightTextColorKey}" />
28+
<DynamicResource x:Key="SystemColorHighlightColor" ResourceKey="{x:Static SystemColors.HighlightColorKey}" />
29+
<DynamicResource x:Key="SystemColorButtonTextColor" ResourceKey="{x:Static SystemColors.ControlTextColorKey}" />
30+
<DynamicResource x:Key="SystemColorButtonFaceColor" ResourceKey="{x:Static SystemColors.ControlColorKey}" />
31+
<DynamicResource x:Key="SystemColorHotlightColor" ResourceKey="{x:Static SystemColors.HotTrackColorKey}" />
32+
<DynamicResource x:Key="SystemColorGrayTextColor" ResourceKey="{x:Static SystemColors.GrayTextColorKey}" />
3433

3534
<Color x:Key="ApplicationBackgroundColor">#2D3236</Color>
3635
<!-- Same as SystemColorWindowColor -->
37-
<SolidColorBrush x:Key="ApplicationBackgroundBrush" Color="{StaticResource ApplicationBackgroundColor}" />
36+
<SolidColorBrush x:Key="ApplicationBackgroundBrush" Color="{StaticResource SystemColorWindowColor}" />
3837

3938
<Color x:Key="KeyboardFocusBorderColor">#FFFFFF</Color>
4039
<!-- Same as SystemColorWindowTextColor -->
41-
<SolidColorBrush x:Key="KeyboardFocusBorderColorBrush" Color="{StaticResource KeyboardFocusBorderColor}" />
40+
<SolidColorBrush x:Key="KeyboardFocusBorderColorBrush" Color="{StaticResource SystemColorWindowTextColor}" />
4241

4342
<!-- Brushes -->
4443

@@ -133,18 +132,18 @@
133132
<SolidColorBrush x:Key="SolidBackgroundFillColorQuarternaryBrush" Color="{StaticResource SystemColorWindowColor}" />
134133
<SolidColorBrush x:Key="SolidBackgroundFillColorBaseAltBrush" Color="{StaticResource SystemColorWindowColor}" />
135134

136-
<SolidColorBrush x:Key="SystemFillColorSuccessBrush" Color="{StaticResource SystemFillColorSuccess}" />
137-
<SolidColorBrush x:Key="SystemFillColorCautionBrush" Color="{StaticResource SystemFillColorCaution}" />
138-
<SolidColorBrush x:Key="SystemFillColorCriticalBrush" Color="{StaticResource SystemFillColorCritical}" />
139-
<SolidColorBrush x:Key="SystemFillColorNeutralBrush" Color="{StaticResource SystemFillColorNeutral}" />
140-
<SolidColorBrush x:Key="SystemFillColorSolidNeutralBrush" Color="{StaticResource SystemFillColorSolidNeutral}" />
141-
<SolidColorBrush x:Key="SystemFillColorAttentionBackgroundBrush" Color="{StaticResource SystemFillColorAttentionBackground}" />
142-
<SolidColorBrush x:Key="SystemFillColorSuccessBackgroundBrush" Color="{StaticResource SystemFillColorSuccessBackground}" />
143-
<SolidColorBrush x:Key="SystemFillColorCautionBackgroundBrush" Color="{StaticResource SystemFillColorCautionBackground}" />
144-
<SolidColorBrush x:Key="SystemFillColorCriticalBackgroundBrush" Color="{StaticResource SystemFillColorCriticalBackground}" />
145-
<SolidColorBrush x:Key="SystemFillColorNeutralBackgroundBrush" Color="{StaticResource SystemFillColorNeutralBackground}" />
146-
<SolidColorBrush x:Key="SystemFillColorSolidAttentionBackgroundBrush" Color="{StaticResource SystemFillColorSolidAttentionBackground}" />
147-
<SolidColorBrush x:Key="SystemFillColorSolidNeutralBackgroundBrush" Color="{StaticResource SystemFillColorSolidNeutralBackground}" />
135+
<SolidColorBrush x:Key="SystemFillColorSuccessBrush" Color="{StaticResource SystemColorWindowTextColor}" />
136+
<SolidColorBrush x:Key="SystemFillColorCautionBrush" Color="{StaticResource SystemColorWindowTextColor}" />
137+
<SolidColorBrush x:Key="SystemFillColorCriticalBrush" Color="{StaticResource SystemColorWindowTextColor}" />
138+
<SolidColorBrush x:Key="SystemFillColorNeutralBrush" Color="{StaticResource SystemColorWindowTextColor}" />
139+
<SolidColorBrush x:Key="SystemFillColorSolidNeutralBrush" Color="{StaticResource SystemColorWindowTextColor}" />
140+
<SolidColorBrush x:Key="SystemFillColorAttentionBackgroundBrush" Color="{StaticResource SystemColorWindowColor}" />
141+
<SolidColorBrush x:Key="SystemFillColorSuccessBackgroundBrush" Color="{StaticResource SystemColorWindowColor}" />
142+
<SolidColorBrush x:Key="SystemFillColorCautionBackgroundBrush" Color="{StaticResource SystemColorWindowColor}" />
143+
<SolidColorBrush x:Key="SystemFillColorCriticalBackgroundBrush" Color="{StaticResource SystemColorWindowColor}" />
144+
<SolidColorBrush x:Key="SystemFillColorNeutralBackgroundBrush" Color="{StaticResource SystemColorWindowColor}" />
145+
<SolidColorBrush x:Key="SystemFillColorSolidAttentionBackgroundBrush" Color="{StaticResource SystemColorWindowColor}" />
146+
<SolidColorBrush x:Key="SystemFillColorSolidNeutralBackgroundBrush" Color="{StaticResource SystemColorWindowColor}" />
148147

149148
<!-- Elevation border brushes -->
150149

0 commit comments

Comments
 (0)