|
5 | 5 | <Setter Property="Foreground" Value="Black"/>
|
6 | 6 | <Setter Property="Height" Value="16"/>
|
7 | 7 | <Setter Property="Width" Value="16"/>
|
| 8 | + <Setter Property="Margin" Value="0"/> |
| 9 | + <Setter Property="Padding" Value="0"/> |
8 | 10 | <Setter Property="HorizontalAlignment" Value="Center"/>
|
9 | 11 | <Setter Property="VerticalAlignment" Value="Center"/>
|
| 12 | + <Setter Property="BorderBrush" Value="Transparent"/> |
10 | 13 | <Setter Property="Template">
|
11 | 14 | <Setter.Value>
|
12 | 15 | <ControlTemplate TargetType="ui:OcticonButton">
|
13 |
| - <Grid x:Name="content" Background="Transparent"> |
| 16 | + <Grid x:Name="content" Margin="{TemplateBinding Margin}" Background="Transparent"> |
| 17 | + <VisualStateManager.VisualStateGroups> |
| 18 | + <VisualStateGroup x:Name="CommonStates"> |
| 19 | + <VisualState x:Name="Normal"/> |
| 20 | + <VisualState x:Name="MouseOver"> |
| 21 | + <Storyboard> |
| 22 | + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="(UIElement.Opacity)"> |
| 23 | + <EasingDoubleKeyFrame KeyTime="0" Value="1"/> |
| 24 | + </DoubleAnimationUsingKeyFrames> |
| 25 | + </Storyboard> |
| 26 | + </VisualState> |
| 27 | + <VisualState x:Name="Pressed"> |
| 28 | + <Storyboard> |
| 29 | + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="PressedBorder" Storyboard.TargetProperty="(UIElement.Opacity)"> |
| 30 | + <EasingDoubleKeyFrame KeyTime="0" Value="1"/> |
| 31 | + </DoubleAnimationUsingKeyFrames> |
| 32 | + </Storyboard> |
| 33 | + </VisualState> |
| 34 | + <VisualState x:Name="Disabled"> |
| 35 | + <Storyboard> |
| 36 | + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity"> |
| 37 | + <SplineDoubleKeyFrame KeyTime="0" Value="0.5"/> |
| 38 | + </DoubleAnimationUsingKeyFrames> |
| 39 | + <DoubleAnimationUsingKeyFrames Storyboard.TargetName="contentPresenter" Storyboard.TargetProperty="(UIElement.Opacity)"> |
| 40 | + <EasingDoubleKeyFrame KeyTime="0" Value="0.5"/> |
| 41 | + </DoubleAnimationUsingKeyFrames> |
| 42 | + </Storyboard> |
| 43 | + </VisualState> |
| 44 | + </VisualStateGroup> |
| 45 | + <VisualStateGroup x:Name="FocusStates"> |
| 46 | + <VisualState x:Name="Focused"/> |
| 47 | + <VisualState x:Name="Unfocused"/> |
| 48 | + </VisualStateGroup> |
| 49 | + </VisualStateManager.VisualStateGroups> |
14 | 50 | <Grid.ColumnDefinitions>
|
15 | 51 | <ColumnDefinition Width="Auto"/>
|
16 | 52 | </Grid.ColumnDefinitions>
|
17 |
| - <ui:FixedAspectRatioPanel HorizontalContentAlignment="Center" VerticalContentAlignment="Center" IsHitTestVisible="False"> |
18 |
| - <Viewbox> |
| 53 | + <Border x:Name="Background" |
| 54 | + Background="{TemplateBinding Background}" |
| 55 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 56 | + BorderThickness="1" |
| 57 | + SnapsToDevicePixels="True"/> |
| 58 | + <Rectangle x:Name="DisabledVisualElement" |
| 59 | + Fill="#FFFCFCFC" |
| 60 | + IsHitTestVisible="False" |
| 61 | + Opacity="0" |
| 62 | + SnapsToDevicePixels="True"/> |
| 63 | + <Border x:Name="MouseOverBorder" |
| 64 | + Background="#FFDDDDE6" |
| 65 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 66 | + BorderThickness="1" |
| 67 | + Opacity="0" |
| 68 | + SnapsToDevicePixels="True"/> |
| 69 | + <Border x:Name="PressedBorder" |
| 70 | + Background="#FFCFCFDB" |
| 71 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 72 | + BorderThickness="1" |
| 73 | + Opacity="0" |
| 74 | + SnapsToDevicePixels="True"/> |
| 75 | + <Border x:Name="DefaultVisualElement" |
| 76 | + Background="Transparent" |
| 77 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 78 | + BorderThickness="1" |
| 79 | + Opacity="0" |
| 80 | + SnapsToDevicePixels="True"/> |
| 81 | + <Viewbox xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Width="16" Height="16"> |
| 82 | + <Border BorderBrush="Transparent" BorderThickness="1"> |
| 83 | + |
19 | 84 | <ui:OcticonPath Height="16"
|
20 | 85 | Fill="{TemplateBinding Foreground}"
|
21 | 86 | Icon="{TemplateBinding Icon}"
|
22 | 87 | SnapsToDevicePixels="True"/>
|
23 |
| - </Viewbox> |
24 |
| - </ui:FixedAspectRatioPanel> |
| 88 | + </Border> |
| 89 | + </Viewbox> |
25 | 90 | </Grid>
|
26 | 91 | <ControlTemplate.Triggers>
|
27 |
| - <Trigger Property="IsMouseOver" Value="True"> |
28 |
| - <Setter TargetName="content" Property="Background" Value="#11FFFFFF"/> |
| 92 | + <Trigger Property="IsDefaulted" Value="True"> |
| 93 | + <Setter TargetName="DefaultVisualElement" Property="Opacity" Value="1"/> |
29 | 94 | </Trigger>
|
30 |
| - <Trigger Property="IsPressed" Value="True"> |
31 |
| - <Setter TargetName="content" Property="Background" Value="#11FFFFFF"/> |
| 95 | + <Trigger Property="IsKeyboardFocused" Value="True"> |
| 96 | + <Setter TargetName="DefaultVisualElement" Property="Opacity" Value="1"/> |
32 | 97 | </Trigger>
|
33 |
| - </ControlTemplate.Triggers> |
| 98 | + </ControlTemplate.Triggers> |
34 | 99 | </ControlTemplate>
|
35 | 100 | </Setter.Value>
|
36 | 101 | </Setter>
|
|
0 commit comments