Skip to content

Commit 900946a

Browse files
authored
Fixed DataGrid column header text color in HC mode (#10956)
1 parent 94b3974 commit 900946a

File tree

8 files changed

+11
-0
lines changed

8 files changed

+11
-0
lines changed

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Dark.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,7 @@
532532
<!-- DataGridHeaderBackground is used for PART_FillerColumnHeader and Row Headers
533533
whereas DataGridColumnHeaderBackground is used for Column Headers. This is a bit confusing
534534
but due to transparency in colors had to follow this. -->
535+
<SolidColorBrush x:Key="DataGridColumnHeaderForeground" Color="{StaticResource TextFillColorPrimary}" />
535536
<SolidColorBrush x:Key="DataGridColumnHeaderBackground" Color="{StaticResource SubtleFillColorTransparent}" />
536537
<SolidColorBrush x:Key="DataGridHeaderBackground" Color="{StaticResource SubtleFillColorTertiary}" />
537538
<SolidColorBrush x:Key="DataGridHeaderBackgroundPointerOver" Color="{StaticResource SubtleFillColorSecondary}" />

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/HC.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@
351351
<SolidColorBrush x:Key="DataGridColumnFloatingHeaderBorderBrush" Color="{StaticResource SystemColorHighlightColor}" />
352352
<SolidColorBrush x:Key="DataGridHeaderDropSeparatorBackground" Color="{StaticResource SystemColorHighlightColor}" />
353353
<SolidColorBrush x:Key="DataGridHeaderSeparatorBrush" Color="{StaticResource SystemColorButtonTextColor}" />
354+
<SolidColorBrush x:Key="DataGridColumnHeaderForeground" Color="{StaticResource SystemColorButtonTextColor}" />
354355
<SolidColorBrush x:Key="DataGridColumnHeaderBackground" Color="Transparent" />
355356
<SolidColorBrush x:Key="DataGridHeaderBackground" Color="{StaticResource SystemColorButtonFaceColor}" />
356357
<SolidColorBrush x:Key="DataGridHeaderBackgroundPointerOver" Color="{StaticResource SystemColorHighlightTextColor}" />

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Resources/Theme/Light.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@
548548
<!-- DataGridHeaderBackground is used for PART_FillerColumnHeader and Row Headers
549549
whereas DataGridColumnHeaderBackground is used for Column Headers. This is a bit confusing
550550
but due to transparency in colors had to follow this. -->
551+
<SolidColorBrush x:Key="DataGridColumnHeaderForeground" Color="{StaticResource TextFillColorPrimary}" />
551552
<SolidColorBrush x:Key="DataGridColumnHeaderBackground" Color="{StaticResource SubtleFillColorTransparent}" />
552553
<SolidColorBrush x:Key="DataGridHeaderBackground" Color="{StaticResource SubtleFillColorTertiary}" />
553554
<SolidColorBrush x:Key="DataGridHeaderBackgroundPointerOver" Color="{StaticResource SubtleFillColorSecondary}" />

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Styles/DataGrid.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@
404404

405405
<!-- Style and template for the DataGridColumnHeader. -->
406406
<Style x:Key="DefaultDataGridColumnHeaderStyle" TargetType="{x:Type DataGridColumnHeader}">
407+
<Setter Property="Foreground" Value="{DynamicResource DataGridColumnHeaderForeground}" />
407408
<Setter Property="Background" Value="{DynamicResource DataGridColumnHeaderBackground}" />
408409
<Setter Property="BorderBrush" Value="{DynamicResource DataGridHeaderBorderBrush}" />
409410
<Setter Property="MinHeight" Value="{StaticResource DataGridColumnHeaderMinHeight}" />

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.Dark.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@
526526
<!-- DataGridHeaderBackground is used for PART_FillerColumnHeader and Row Headers
527527
whereas DataGridColumnHeaderBackground is used for Column Headers. This is a bit confusing
528528
but due to transparency in colors had to follow this. -->
529+
<SolidColorBrush x:Key="DataGridColumnHeaderForeground" Color="{StaticResource TextFillColorPrimary}" />
529530
<SolidColorBrush x:Key="DataGridColumnHeaderBackground" Color="{StaticResource SubtleFillColorTransparent}" />
530531
<SolidColorBrush x:Key="DataGridHeaderBackground" Color="{StaticResource SubtleFillColorTertiary}" />
531532
<SolidColorBrush x:Key="DataGridHeaderBackgroundPointerOver" Color="{StaticResource SubtleFillColorSecondary}" />
@@ -2161,6 +2162,7 @@
21612162
</Style>
21622163
<!-- Style and template for the DataGridColumnHeader. -->
21632164
<Style x:Key="DefaultDataGridColumnHeaderStyle" TargetType="{x:Type DataGridColumnHeader}">
2165+
<Setter Property="Foreground" Value="{DynamicResource DataGridColumnHeaderForeground}" />
21642166
<Setter Property="Background" Value="{DynamicResource DataGridColumnHeaderBackground}" />
21652167
<Setter Property="BorderBrush" Value="{DynamicResource DataGridHeaderBorderBrush}" />
21662168
<Setter Property="MinHeight" Value="{StaticResource DataGridColumnHeaderMinHeight}" />

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.HC.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,7 @@
370370
<SolidColorBrush x:Key="DataGridColumnFloatingHeaderBorderBrush" Color="{StaticResource SystemColorHighlightColor}" />
371371
<SolidColorBrush x:Key="DataGridHeaderDropSeparatorBackground" Color="{StaticResource SystemColorHighlightColor}" />
372372
<SolidColorBrush x:Key="DataGridHeaderSeparatorBrush" Color="{StaticResource SystemColorButtonTextColor}" />
373+
<SolidColorBrush x:Key="DataGridColumnHeaderForeground" Color="{StaticResource SystemColorButtonTextColor}" />
373374
<SolidColorBrush x:Key="DataGridColumnHeaderBackground" Color="Transparent" />
374375
<SolidColorBrush x:Key="DataGridHeaderBackground" Color="{StaticResource SystemColorButtonFaceColor}" />
375376
<SolidColorBrush x:Key="DataGridHeaderBackgroundPointerOver" Color="{StaticResource SystemColorHighlightTextColor}" />
@@ -2061,6 +2062,7 @@
20612062
</Style>
20622063
<!-- Style and template for the DataGridColumnHeader. -->
20632064
<Style x:Key="DefaultDataGridColumnHeaderStyle" TargetType="{x:Type DataGridColumnHeader}">
2065+
<Setter Property="Foreground" Value="{DynamicResource DataGridColumnHeaderForeground}" />
20642066
<Setter Property="Background" Value="{DynamicResource DataGridColumnHeaderBackground}" />
20652067
<Setter Property="BorderBrush" Value="{DynamicResource DataGridHeaderBorderBrush}" />
20662068
<Setter Property="MinHeight" Value="{StaticResource DataGridColumnHeaderMinHeight}" />

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.Light.xaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -541,6 +541,7 @@
541541
<!-- DataGridHeaderBackground is used for PART_FillerColumnHeader and Row Headers
542542
whereas DataGridColumnHeaderBackground is used for Column Headers. This is a bit confusing
543543
but due to transparency in colors had to follow this. -->
544+
<SolidColorBrush x:Key="DataGridColumnHeaderForeground" Color="{StaticResource TextFillColorPrimary}" />
544545
<SolidColorBrush x:Key="DataGridColumnHeaderBackground" Color="{StaticResource SubtleFillColorTransparent}" />
545546
<SolidColorBrush x:Key="DataGridHeaderBackground" Color="{StaticResource SubtleFillColorTertiary}" />
546547
<SolidColorBrush x:Key="DataGridHeaderBackgroundPointerOver" Color="{StaticResource SubtleFillColorSecondary}" />
@@ -2176,6 +2177,7 @@
21762177
</Style>
21772178
<!-- Style and template for the DataGridColumnHeader. -->
21782179
<Style x:Key="DefaultDataGridColumnHeaderStyle" TargetType="{x:Type DataGridColumnHeader}">
2180+
<Setter Property="Foreground" Value="{DynamicResource DataGridColumnHeaderForeground}" />
21792181
<Setter Property="Background" Value="{DynamicResource DataGridColumnHeaderBackground}" />
21802182
<Setter Property="BorderBrush" Value="{DynamicResource DataGridHeaderBorderBrush}" />
21812183
<Setter Property="MinHeight" Value="{StaticResource DataGridColumnHeaderMinHeight}" />

src/Microsoft.DotNet.Wpf/src/Themes/PresentationFramework.Fluent/Themes/Fluent.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,6 +1359,7 @@
13591359
</Style>
13601360
<!-- Style and template for the DataGridColumnHeader. -->
13611361
<Style x:Key="DefaultDataGridColumnHeaderStyle" TargetType="{x:Type DataGridColumnHeader}">
1362+
<Setter Property="Foreground" Value="{DynamicResource DataGridColumnHeaderForeground}" />
13621363
<Setter Property="Background" Value="{DynamicResource DataGridColumnHeaderBackground}" />
13631364
<Setter Property="BorderBrush" Value="{DynamicResource DataGridHeaderBorderBrush}" />
13641365
<Setter Property="MinHeight" Value="{StaticResource DataGridColumnHeaderMinHeight}" />

0 commit comments

Comments
 (0)