Browse Source

Merge pull request #4773 from AvaloniaUI/fixes/path-icon-centered

ensure path icon is centered.
pull/4783/head
danwalmsley 6 years ago
committed by GitHub
parent
commit
0c167b21f9
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/Avalonia.Themes.Default/PathIcon.xaml
  2. 7
      src/Avalonia.Themes.Fluent/PathIcon.xaml

7
src/Avalonia.Themes.Default/PathIcon.xaml

@ -2,14 +2,15 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style Selector="PathIcon">
<Setter Property="Foreground" Value="{DynamicResource ThemeForegroundColor}" />
<Setter Property="Height" Value="16" />
<Setter Property="Width" Value="16" />
<Setter Property="Height" Value="{DynamicResource IconElementThemeHeight}" />
<Setter Property="Width" Value="{DynamicResource IconElementThemeWidth}" />
<Setter Property="Template">
<ControlTemplate>
<Viewbox Height="{TemplateBinding Height}"
Width="{TemplateBinding Width}">
<Path Fill="{TemplateBinding Foreground}"
Data="{TemplateBinding Data}" />
Data="{TemplateBinding Data}"
Stretch="Uniform" />
</Viewbox>
</ControlTemplate>
</Setter>

7
src/Avalonia.Themes.Fluent/PathIcon.xaml

@ -10,14 +10,15 @@
</Design.PreviewWith>
<Style Selector="PathIcon">
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" />
<Setter Property="Height" Value="16" />
<Setter Property="Width" Value="16" />
<Setter Property="Height" Value="{DynamicResource IconElementThemeHeight}" />
<Setter Property="Width" Value="{DynamicResource IconElementThemeWidth}" />
<Setter Property="Template">
<ControlTemplate>
<Viewbox Height="{TemplateBinding Height}"
Width="{TemplateBinding Width}">
<Path Fill="{TemplateBinding Foreground}"
Data="{TemplateBinding Data}" />
Data="{TemplateBinding Data}"
Stretch="Uniform" />
</Viewbox>
</ControlTemplate>
</Setter>

Loading…
Cancel
Save