Skip to content

Commit 96d0050

Browse files
authored
Adds trigger for disabled state for Thumb (#10795)
1 parent deaa1ee commit 96d0050

File tree

7 files changed

+30
-3
lines changed

7 files changed

+30
-3
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
@@ -790,6 +790,7 @@
790790

791791
<!-- Thumb -->
792792
<SolidColorBrush x:Key="ThumbBackground" Color="{StaticResource ControlStrongFillColorDefault}" />
793+
<SolidColorBrush x:Key="ThumbBackgroundDisabled" Color="{StaticResource ControlStrongFillColorDisabled}" />
793794

794795
<!-- ThumbRate -->
795796
<SolidColorBrush x:Key="ThumbRateForeground" Color="{StaticResource SystemAccentColorLight3}" />

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
@@ -596,6 +596,7 @@
596596

597597
<!-- Thumb -->
598598
<SolidColorBrush x:Key="ThumbBackground" Color="{StaticResource SystemColorButtonTextColor}" />
599+
<SolidColorBrush x:Key="ThumbBackgroundDisabled" Color="{StaticResource SystemColorButtonFaceColor}" />
599600

600601
<!-- ThumbRate -->
601602
<SolidColorBrush x:Key="ThumbRateForeground" Color="{StaticResource SystemColorHighlightColor}" />

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
@@ -799,6 +799,7 @@
799799

800800
<!-- Thumb -->
801801
<SolidColorBrush x:Key="ThumbBackground" Color="{StaticResource ControlStrongFillColorDefault}" />
802+
<SolidColorBrush x:Key="ThumbBackgroundDisabled" Color="{StaticResource ControlStrongFillColorDisabled}" />
802803

803804
<!-- ThumbRate -->
804805
<SolidColorBrush x:Key="ThumbRateForeground" Color="{StaticResource SystemAccentColorDark1}" />

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,16 @@
1414
<Setter.Value>
1515
<ControlTemplate TargetType="{x:Type Thumb}">
1616
<Border
17+
x:Name="Border"
1718
Background="{TemplateBinding Background}"
1819
BorderBrush="{TemplateBinding BorderBrush}"
1920
BorderThickness="{TemplateBinding BorderThickness}"
2021
CornerRadius="{TemplateBinding Border.CornerRadius}" />
22+
<ControlTemplate.Triggers>
23+
<Trigger Property="IsEnabled" Value="False">
24+
<Setter TargetName="Border" Property="Background" Value="{DynamicResource ThumbBackgroundDisabled}" />
25+
</Trigger>
26+
</ControlTemplate.Triggers>
2127
</ControlTemplate>
2228
</Setter.Value>
2329
</Setter>

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -746,6 +746,7 @@
746746
<SolidColorBrush x:Key="TextControlPlaceholderForeground" Color="{StaticResource TextFillColorSecondary}" />
747747
<!-- Thumb -->
748748
<SolidColorBrush x:Key="ThumbBackground" Color="{StaticResource ControlStrongFillColorDefault}" />
749+
<SolidColorBrush x:Key="ThumbBackgroundDisabled" Color="{StaticResource ControlStrongFillColorDisabled}" />
749750
<!-- ThumbRate -->
750751
<SolidColorBrush x:Key="ThumbRateForeground" Color="{StaticResource SystemAccentColorLight3}" />
751752
<!-- TimePicker -->
@@ -4980,7 +4981,12 @@
49804981
<Setter Property="Template">
49814982
<Setter.Value>
49824983
<ControlTemplate TargetType="{x:Type Thumb}">
4983-
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding Border.CornerRadius}" />
4984+
<Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding Border.CornerRadius}" />
4985+
<ControlTemplate.Triggers>
4986+
<Trigger Property="IsEnabled" Value="False">
4987+
<Setter TargetName="Border" Property="Background" Value="{DynamicResource ThumbBackgroundDisabled}" />
4988+
</Trigger>
4989+
</ControlTemplate.Triggers>
49844990
</ControlTemplate>
49854991
</Setter.Value>
49864992
</Setter>

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,7 @@
576576
<SolidColorBrush x:Key="TextControlPlaceholderForeground" Color="{StaticResource SystemColorGrayTextColor}" />
577577
<!-- Thumb -->
578578
<SolidColorBrush x:Key="ThumbBackground" Color="{StaticResource SystemColorButtonTextColor}" />
579+
<SolidColorBrush x:Key="ThumbBackgroundDisabled" Color="{StaticResource SystemColorButtonFaceColor}" />
579580
<!-- ThumbRate -->
580581
<SolidColorBrush x:Key="ThumbRateForeground" Color="{StaticResource SystemColorHighlightColor}" />
581582
<!-- TimePicker -->
@@ -4893,7 +4894,12 @@
48934894
<Setter Property="Template">
48944895
<Setter.Value>
48954896
<ControlTemplate TargetType="{x:Type Thumb}">
4896-
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding Border.CornerRadius}" />
4897+
<Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding Border.CornerRadius}" />
4898+
<ControlTemplate.Triggers>
4899+
<Trigger Property="IsEnabled" Value="False">
4900+
<Setter TargetName="Border" Property="Background" Value="{DynamicResource ThumbBackgroundDisabled}" />
4901+
</Trigger>
4902+
</ControlTemplate.Triggers>
48974903
</ControlTemplate>
48984904
</Setter.Value>
48994905
</Setter>

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,7 @@
755755
<SolidColorBrush x:Key="TextControlPlaceholderForeground" Color="{StaticResource TextFillColorSecondary}" />
756756
<!-- Thumb -->
757757
<SolidColorBrush x:Key="ThumbBackground" Color="{StaticResource ControlStrongFillColorDefault}" />
758+
<SolidColorBrush x:Key="ThumbBackgroundDisabled" Color="{StaticResource ControlStrongFillColorDisabled}" />
758759
<!-- ThumbRate -->
759760
<SolidColorBrush x:Key="ThumbRateForeground" Color="{StaticResource SystemAccentColorDark1}" />
760761
<!-- TimePicker -->
@@ -4989,7 +4990,12 @@
49894990
<Setter Property="Template">
49904991
<Setter.Value>
49914992
<ControlTemplate TargetType="{x:Type Thumb}">
4992-
<Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding Border.CornerRadius}" />
4993+
<Border x:Name="Border" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding Border.CornerRadius}" />
4994+
<ControlTemplate.Triggers>
4995+
<Trigger Property="IsEnabled" Value="False">
4996+
<Setter TargetName="Border" Property="Background" Value="{DynamicResource ThumbBackgroundDisabled}" />
4997+
</Trigger>
4998+
</ControlTemplate.Triggers>
49934999
</ControlTemplate>
49945000
</Setter.Value>
49955001
</Setter>

0 commit comments

Comments
 (0)