Skip to content

Commit 882b8e1

Browse files
authored
Fixed bug with icon size
ToolBar icon size wasn't contained within toolbar. So made it part of ToolBar ControlTemplate Resources
1 parent 4d16b69 commit 882b8e1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ToolBar.xaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,12 @@
126126
<Setter Property="Template">
127127
<Setter.Value>
128128
<ControlTemplate TargetType="{x:Type ToolBar}">
129+
<ControlTemplate.Resources>
130+
<Style TargetType="{x:Type wpf:PackIcon}" >
131+
<Setter Property="Width" Value="22" />
132+
<Setter Property="Height" Value="22" />
133+
</Style>
134+
</ControlTemplate.Resources>
129135
<DockPanel x:Name="Grid" Margin="3,1,1,1" SnapsToDevicePixels="true" Background="{TemplateBinding Background}">
130136
<Grid DockPanel.Dock="Right" x:Name="OverflowGrid" HorizontalAlignment="Right">
131137
<ToggleButton x:Name="OverflowButton" ClickMode="Press" FocusVisualStyle="{x:Null}"
@@ -208,10 +214,6 @@
208214
<Style x:Key="{x:Static ToolBar.RadioButtonStyleKey}" TargetType="{x:Type RadioButton}" BasedOn="{StaticResource MaterialDesignRadioButton}">
209215
<Setter Property="Margin" Value="8 0 8 0" />
210216
</Style>
211-
<Style TargetType="{x:Type wpf:PackIcon}" >
212-
<Setter Property="Width" Value="22" />
213-
<Setter Property="Height" Value="22" />
214-
</Style>
215217
<Style x:Key="{x:Static ToolBar.SeparatorStyleKey}" TargetType="Separator">
216218
<Setter Property="Background" Value="{DynamicResource MaterialDesignDivider}"/>
217219
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignDivider}"/>
@@ -266,4 +268,4 @@
266268
</Setter>
267269
</Style>
268270

269-
</ResourceDictionary>
271+
</ResourceDictionary>

0 commit comments

Comments
 (0)