Generic.xaml
1 <ResourceDictionary 2 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 3 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 4 xmlns:controls="using:Microsoft.PowerToys.Settings.UI.Controls"> 5 6 <Style TargetType="controls:FlyoutMenuButton"> 7 <Setter Property="HorizontalAlignment" Value="Stretch" /> 8 <Setter Property="VerticalAlignment" Value="Stretch" /> 9 <Setter Property="Width" Value="116" /> 10 <Setter Property="Height" Value="84" /> 11 <Setter Property="FontFamily" Value="{ThemeResource ContentControlThemeFontFamily}" /> 12 <Setter Property="FontWeight" Value="Normal" /> 13 <Setter Property="FontSize" Value="{ThemeResource ControlContentThemeFontSize}" /> 14 <Setter Property="UseSystemFocusVisuals" Value="{StaticResource UseSystemFocusVisuals}" /> 15 <Setter Property="FocusVisualMargin" Value="-3" /> 16 <Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" /> 17 <Setter Property="Template"> 18 <Setter.Value> 19 <ControlTemplate TargetType="controls:FlyoutMenuButton"> 20 <Grid 21 x:Name="RootGrid" 22 Width="{TemplateBinding Width}" 23 Height="{TemplateBinding Height}" 24 HorizontalAlignment="Stretch" 25 VerticalAlignment="Stretch" 26 Background="Transparent" 27 BackgroundSizing="InnerBorderEdge" 28 CornerRadius="{TemplateBinding CornerRadius}"> 29 <Grid.BackgroundTransition> 30 <BrushTransition Duration="0:0:0.083" /> 31 </Grid.BackgroundTransition> 32 <ContentPresenter 33 x:Name="ContentPresenter" 34 Margin="0,52,0,0" 35 HorizontalAlignment="Center" 36 VerticalAlignment="Top" 37 Content="{TemplateBinding Content}" /> 38 39 40 <ContentPresenter 41 x:Name="IconPresenter" 42 Width="32" 43 Margin="0,12,0,0" 44 HorizontalAlignment="Center" 45 VerticalAlignment="Top" 46 Content="{TemplateBinding Icon}" 47 RenderTransformOrigin="0.5, 0.5"> 48 <ContentPresenter.RenderTransform> 49 <CompositeTransform /> 50 </ContentPresenter.RenderTransform> 51 </ContentPresenter> 52 <VisualStateManager.VisualStateGroups> 53 <VisualStateGroup x:Name="CommonStates"> 54 <VisualState x:Name="Normal" /> 55 <VisualState x:Name="PointerOver"> 56 <Storyboard> 57 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> 58 <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ControlFillColorDefaultBrush}" /> 59 </ObjectAnimationUsingKeyFrames> 60 </Storyboard> 61 </VisualState> 62 63 <VisualState x:Name="Pressed"> 64 <Storyboard> 65 <DoubleAnimationUsingKeyFrames Storyboard.TargetName="IconPresenter" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleX)"> 66 <SplineDoubleKeyFrame 67 KeySpline="{StaticResource ControlFastOutSlowInKeySpline}" 68 KeyTime="{StaticResource ControlFastAnimationDuration}" 69 Value="0.86" /> 70 </DoubleAnimationUsingKeyFrames> 71 <DoubleAnimationUsingKeyFrames Storyboard.TargetName="IconPresenter" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.ScaleY)"> 72 <SplineDoubleKeyFrame 73 KeySpline="{StaticResource ControlFastOutSlowInKeySpline}" 74 KeyTime="{StaticResource ControlFastAnimationDuration}" 75 Value="0.86" /> 76 </DoubleAnimationUsingKeyFrames> 77 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="RootGrid" Storyboard.TargetProperty="Background"> 78 <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ControlFillColorDefaultBrush}" /> 79 </ObjectAnimationUsingKeyFrames> 80 </Storyboard> 81 82 </VisualState> 83 84 <VisualState x:Name="Disabled"> 85 <Storyboard> 86 <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter" Storyboard.TargetProperty="Foreground"> 87 <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ButtonForegroundDisabled}" /> 88 </ObjectAnimationUsingKeyFrames> 89 </Storyboard> 90 91 </VisualState> 92 </VisualStateGroup> 93 </VisualStateManager.VisualStateGroups> 94 </Grid> 95 </ControlTemplate> 96 </Setter.Value> 97 </Setter> 98 </Style> 99 </ResourceDictionary>