Skip to content

Commit 82de5b5

Browse files
authored
Updates styling for different controls in ToolBar in Fluent (#10545)
* Changed ToggleButton and CheckBox styling in Toolbar * Updated styling for controls in ToolBar * Updating the style for Separator in toolbar * Reverting a change in HC.xaml
1 parent 9711cb8 commit 82de5b5

File tree

6 files changed

+49
-17
lines changed

6 files changed

+49
-17
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@
668668

669669
<Color x:Key="ControlStrongFillColorDefault">#2D3236</Color>
670670
<Color x:Key="ControlStrongFillColorDisabled">#2D3236</Color>
671-
671+
672672
<Color x:Key="ControlSolidFillColorDefault">#2D3236</Color>
673673

674674
<Color x:Key="SubtleFillColorTransparent">#2D3236</Color>

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
99

10-
<Style TargetType="{x:Type Separator}">
10+
<Style x:Key="DefaultSeparatorStyle" TargetType="{x:Type Separator}">
1111
<Setter Property="BorderBrush" Value="{DynamicResource SeparatorBorderBrush}" />
1212
<Setter Property="Background" Value="Transparent" />
1313
<Setter Property="Margin" Value="0" />
@@ -29,4 +29,6 @@
2929
</Setter>
3030
</Style>
3131

32+
<Style BasedOn="{StaticResource DefaultSeparatorStyle}" TargetType="{x:Type Separator}" />
33+
3234
</ResourceDictionary>

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

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,37 @@
7676
x:Key="{x:Static ToolBar.ButtonStyleKey}"
7777
BasedOn="{StaticResource ToolBarButtonBaseStyle}"
7878
TargetType="{x:Type Button}" />
79+
7980
<Style
8081
x:Key="{x:Static ToolBar.ToggleButtonStyleKey}"
81-
BasedOn="{StaticResource ToolBarButtonBaseStyle}"
82+
BasedOn="{StaticResource DefaultToggleButtonStyle}"
8283
TargetType="{x:Type ToggleButton}" />
84+
8385
<Style
8486
x:Key="{x:Static ToolBar.CheckBoxStyleKey}"
85-
BasedOn="{StaticResource ToolBarButtonBaseStyle}"
87+
BasedOn="{StaticResource DefaultCheckBoxStyle}"
8688
TargetType="{x:Type CheckBox}" />
89+
8790
<Style
8891
x:Key="{x:Static ToolBar.RadioButtonStyleKey}"
89-
BasedOn="{StaticResource ToolBarButtonBaseStyle}"
92+
BasedOn="{StaticResource DefaultRadioButtonStyle}"
9093
TargetType="{x:Type RadioButton}" />
9194

95+
<Style
96+
x:Key="{x:Static ToolBar.ComboBoxStyleKey}"
97+
BasedOn="{StaticResource DefaultComboBoxStyle}"
98+
TargetType="{x:Type ComboBox}" />
99+
100+
<Style
101+
x:Key="{x:Static ToolBar.MenuStyleKey}"
102+
BasedOn="{StaticResource DefaultMenuStyle}"
103+
TargetType="{x:Type Menu}" />
104+
105+
<Style
106+
x:Key="{x:Static ToolBar.SeparatorStyleKey}"
107+
BasedOn="{StaticResource DefaultSeparatorStyle}"
108+
TargetType="{x:Type Separator}" />
109+
92110
<Style x:Key="{x:Static ToolBar.TextBoxStyleKey}" TargetType="{x:Type TextBox}">
93111
<Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
94112
<Setter Property="FocusVisualStyle" Value="{x:Null}" />

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3914,7 +3914,7 @@
39143914
</Setter>
39153915
</Style>
39163916
<Style BasedOn="{StaticResource DefaultScrollViewerStyle}" TargetType="{x:Type ScrollViewer}" />
3917-
<Style TargetType="{x:Type Separator}">
3917+
<Style x:Key="DefaultSeparatorStyle" TargetType="{x:Type Separator}">
39183918
<Setter Property="BorderBrush" Value="{DynamicResource SeparatorBorderBrush}" />
39193919
<Setter Property="Background" Value="Transparent" />
39203920
<Setter Property="Margin" Value="0" />
@@ -3930,6 +3930,7 @@
39303930
</Setter.Value>
39313931
</Setter>
39323932
</Style>
3933+
<Style BasedOn="{StaticResource DefaultSeparatorStyle}" TargetType="{x:Type Separator}" />
39333934
<Style x:Key="SliderButtonStyle" TargetType="{x:Type RepeatButton}">
39343935
<Setter Property="IsTabStop" Value="False" />
39353936
<Setter Property="Focusable" Value="False" />
@@ -4672,9 +4673,12 @@
46724673
</Setter>
46734674
</Style>
46744675
<Style x:Key="{x:Static ToolBar.ButtonStyleKey}" BasedOn="{StaticResource ToolBarButtonBaseStyle}" TargetType="{x:Type Button}" />
4675-
<Style x:Key="{x:Static ToolBar.ToggleButtonStyleKey}" BasedOn="{StaticResource ToolBarButtonBaseStyle}" TargetType="{x:Type ToggleButton}" />
4676-
<Style x:Key="{x:Static ToolBar.CheckBoxStyleKey}" BasedOn="{StaticResource ToolBarButtonBaseStyle}" TargetType="{x:Type CheckBox}" />
4677-
<Style x:Key="{x:Static ToolBar.RadioButtonStyleKey}" BasedOn="{StaticResource ToolBarButtonBaseStyle}" TargetType="{x:Type RadioButton}" />
4676+
<Style x:Key="{x:Static ToolBar.ToggleButtonStyleKey}" BasedOn="{StaticResource DefaultToggleButtonStyle}" TargetType="{x:Type ToggleButton}" />
4677+
<Style x:Key="{x:Static ToolBar.CheckBoxStyleKey}" BasedOn="{StaticResource DefaultCheckBoxStyle}" TargetType="{x:Type CheckBox}" />
4678+
<Style x:Key="{x:Static ToolBar.RadioButtonStyleKey}" BasedOn="{StaticResource DefaultRadioButtonStyle}" TargetType="{x:Type RadioButton}" />
4679+
<Style x:Key="{x:Static ToolBar.ComboBoxStyleKey}" BasedOn="{StaticResource DefaultComboBoxStyle}" TargetType="{x:Type ComboBox}" />
4680+
<Style x:Key="{x:Static ToolBar.MenuStyleKey}" BasedOn="{StaticResource DefaultMenuStyle}" TargetType="{x:Type Menu}" />
4681+
<Style x:Key="{x:Static ToolBar.SeparatorStyleKey}" BasedOn="{StaticResource DefaultSeparatorStyle}" TargetType="{x:Type Separator}" />
46784682
<Style x:Key="{x:Static ToolBar.TextBoxStyleKey}" TargetType="{x:Type TextBox}">
46794683
<Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
46804684
<Setter Property="FocusVisualStyle" Value="{x:Null}" />

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3895,7 +3895,7 @@
38953895
</Setter>
38963896
</Style>
38973897
<Style BasedOn="{StaticResource DefaultScrollViewerStyle}" TargetType="{x:Type ScrollViewer}" />
3898-
<Style TargetType="{x:Type Separator}">
3898+
<Style x:Key="DefaultSeparatorStyle" TargetType="{x:Type Separator}">
38993899
<Setter Property="BorderBrush" Value="{DynamicResource SeparatorBorderBrush}" />
39003900
<Setter Property="Background" Value="Transparent" />
39013901
<Setter Property="Margin" Value="0" />
@@ -3911,6 +3911,7 @@
39113911
</Setter.Value>
39123912
</Setter>
39133913
</Style>
3914+
<Style BasedOn="{StaticResource DefaultSeparatorStyle}" TargetType="{x:Type Separator}" />
39143915
<Style x:Key="SliderButtonStyle" TargetType="{x:Type RepeatButton}">
39153916
<Setter Property="IsTabStop" Value="False" />
39163917
<Setter Property="Focusable" Value="False" />
@@ -4653,9 +4654,12 @@
46534654
</Setter>
46544655
</Style>
46554656
<Style x:Key="{x:Static ToolBar.ButtonStyleKey}" BasedOn="{StaticResource ToolBarButtonBaseStyle}" TargetType="{x:Type Button}" />
4656-
<Style x:Key="{x:Static ToolBar.ToggleButtonStyleKey}" BasedOn="{StaticResource ToolBarButtonBaseStyle}" TargetType="{x:Type ToggleButton}" />
4657-
<Style x:Key="{x:Static ToolBar.CheckBoxStyleKey}" BasedOn="{StaticResource ToolBarButtonBaseStyle}" TargetType="{x:Type CheckBox}" />
4658-
<Style x:Key="{x:Static ToolBar.RadioButtonStyleKey}" BasedOn="{StaticResource ToolBarButtonBaseStyle}" TargetType="{x:Type RadioButton}" />
4657+
<Style x:Key="{x:Static ToolBar.ToggleButtonStyleKey}" BasedOn="{StaticResource DefaultToggleButtonStyle}" TargetType="{x:Type ToggleButton}" />
4658+
<Style x:Key="{x:Static ToolBar.CheckBoxStyleKey}" BasedOn="{StaticResource DefaultCheckBoxStyle}" TargetType="{x:Type CheckBox}" />
4659+
<Style x:Key="{x:Static ToolBar.RadioButtonStyleKey}" BasedOn="{StaticResource DefaultRadioButtonStyle}" TargetType="{x:Type RadioButton}" />
4660+
<Style x:Key="{x:Static ToolBar.ComboBoxStyleKey}" BasedOn="{StaticResource DefaultComboBoxStyle}" TargetType="{x:Type ComboBox}" />
4661+
<Style x:Key="{x:Static ToolBar.MenuStyleKey}" BasedOn="{StaticResource DefaultMenuStyle}" TargetType="{x:Type Menu}" />
4662+
<Style x:Key="{x:Static ToolBar.SeparatorStyleKey}" BasedOn="{StaticResource DefaultSeparatorStyle}" TargetType="{x:Type Separator}" />
46594663
<Style x:Key="{x:Static ToolBar.TextBoxStyleKey}" TargetType="{x:Type TextBox}">
46604664
<Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
46614665
<Setter Property="FocusVisualStyle" Value="{x:Null}" />

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3911,7 +3911,7 @@
39113911
</Setter>
39123912
</Style>
39133913
<Style BasedOn="{StaticResource DefaultScrollViewerStyle}" TargetType="{x:Type ScrollViewer}" />
3914-
<Style TargetType="{x:Type Separator}">
3914+
<Style x:Key="DefaultSeparatorStyle" TargetType="{x:Type Separator}">
39153915
<Setter Property="BorderBrush" Value="{DynamicResource SeparatorBorderBrush}" />
39163916
<Setter Property="Background" Value="Transparent" />
39173917
<Setter Property="Margin" Value="0" />
@@ -3927,6 +3927,7 @@
39273927
</Setter.Value>
39283928
</Setter>
39293929
</Style>
3930+
<Style BasedOn="{StaticResource DefaultSeparatorStyle}" TargetType="{x:Type Separator}" />
39303931
<Style x:Key="SliderButtonStyle" TargetType="{x:Type RepeatButton}">
39313932
<Setter Property="IsTabStop" Value="False" />
39323933
<Setter Property="Focusable" Value="False" />
@@ -4669,9 +4670,12 @@
46694670
</Setter>
46704671
</Style>
46714672
<Style x:Key="{x:Static ToolBar.ButtonStyleKey}" BasedOn="{StaticResource ToolBarButtonBaseStyle}" TargetType="{x:Type Button}" />
4672-
<Style x:Key="{x:Static ToolBar.ToggleButtonStyleKey}" BasedOn="{StaticResource ToolBarButtonBaseStyle}" TargetType="{x:Type ToggleButton}" />
4673-
<Style x:Key="{x:Static ToolBar.CheckBoxStyleKey}" BasedOn="{StaticResource ToolBarButtonBaseStyle}" TargetType="{x:Type CheckBox}" />
4674-
<Style x:Key="{x:Static ToolBar.RadioButtonStyleKey}" BasedOn="{StaticResource ToolBarButtonBaseStyle}" TargetType="{x:Type RadioButton}" />
4673+
<Style x:Key="{x:Static ToolBar.ToggleButtonStyleKey}" BasedOn="{StaticResource DefaultToggleButtonStyle}" TargetType="{x:Type ToggleButton}" />
4674+
<Style x:Key="{x:Static ToolBar.CheckBoxStyleKey}" BasedOn="{StaticResource DefaultCheckBoxStyle}" TargetType="{x:Type CheckBox}" />
4675+
<Style x:Key="{x:Static ToolBar.RadioButtonStyleKey}" BasedOn="{StaticResource DefaultRadioButtonStyle}" TargetType="{x:Type RadioButton}" />
4676+
<Style x:Key="{x:Static ToolBar.ComboBoxStyleKey}" BasedOn="{StaticResource DefaultComboBoxStyle}" TargetType="{x:Type ComboBox}" />
4677+
<Style x:Key="{x:Static ToolBar.MenuStyleKey}" BasedOn="{StaticResource DefaultMenuStyle}" TargetType="{x:Type Menu}" />
4678+
<Style x:Key="{x:Static ToolBar.SeparatorStyleKey}" BasedOn="{StaticResource DefaultSeparatorStyle}" TargetType="{x:Type Separator}" />
46754679
<Style x:Key="{x:Static ToolBar.TextBoxStyleKey}" TargetType="{x:Type TextBox}">
46764680
<Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
46774681
<Setter Property="FocusVisualStyle" Value="{x:Null}" />

0 commit comments

Comments
 (0)