Skip to content

Commit c1da26f

Browse files
authored
Fix Settings page text not adopting High Contrast Aquatic/Desert themes (#2463)
Add HighContrast theme dictionary to Settings.xaml that overrides TextFillColorPrimaryBrush and TextFillColorSecondaryBrush to use SystemColorWindowTextColor. Also fix SettingsRichTextBlockStyle using TextFillColorPrimary (a Color) instead of TextFillColorPrimaryBrush (a Brush) for the Foreground property.
1 parent 624a468 commit c1da26f

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/Calculator/Views/Settings.xaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@
1313

1414
<UserControl.Resources>
1515
<ResourceDictionary>
16+
<ResourceDictionary.ThemeDictionaries>
17+
<ResourceDictionary x:Key="HighContrast">
18+
<SolidColorBrush x:Key="TextFillColorPrimaryBrush" Color="{ThemeResource SystemColorWindowTextColor}"/>
19+
<SolidColorBrush x:Key="TextFillColorSecondaryBrush" Color="{ThemeResource SystemColorWindowTextColor}"/>
20+
</ResourceDictionary>
21+
</ResourceDictionary.ThemeDictionaries>
22+
1623
<Style x:Key="SettingsContentScrollViewStyle" TargetType="ScrollViewer">
1724
<Setter Property="HorizontalAlignment" Value="Stretch"/>
1825
<Setter Property="VerticalAlignment" Value="Stretch"/>
@@ -27,7 +34,7 @@
2734

2835
<Style x:Key="SettingsRichTextBlockStyle" TargetType="RichTextBlock">
2936
<Setter Property="HorizontalAlignment" Value="Left"/>
30-
<Setter Property="Foreground" Value="{ThemeResource TextFillColorPrimary}"/>
37+
<Setter Property="Foreground" Value="{ThemeResource TextFillColorPrimaryBrush}"/>
3138
<Setter Property="FontSize" Value="{ThemeResource BodyFontSize}"/>
3239
<Setter Property="TextWrapping" Value="Wrap"/>
3340
</Style>

0 commit comments

Comments
 (0)