ui: Add large-flat button style
This commit is contained in:
1 parent
7b1fa849ef
commit
9cd5d0890f
1 file changed
+144
-8
@@ -1,13 +1,12 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:bv="clr-namespace:bts.view"
|
||||
xmlns:mbts="clr-namespace:mbts.ui"
|
||||
xmlns:u="clr-namespace:mbts.ui"
|
||||
xmlns:controls="clr-namespace:mbts.ui.controls"
|
||||
xmlns:cv="clr-namespace:mbts.ui.converters"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mbts="clr-namespace:mbts.ui"
|
||||
xmlns:u="clr-namespace:mbts.ui"
|
||||
xmlns:controls="clr-namespace:mbts.ui.controls"
|
||||
xmlns:cv="clr-namespace:mbts.ui.converters"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||
>
|
||||
|
||||
<SolidColorBrush x:Key="StartMenuMouseOverBorderBrush" Color="#FFFFB700" />
|
||||
<SolidColorBrush x:Key="StartMenuMouseOverBackground" Color="#6ddbff" />
|
||||
<SolidColorBrush x:Key="StartMenuPressedBorderBrush" Color="#FFC29B29" />
|
||||
@@ -25,6 +24,38 @@
|
||||
<SolidColorBrush x:Key="Button.MousePressed.BackgroundBrush" Color="{StaticResource Button.MousePressed.BackgroundColor}" />
|
||||
<SolidColorBrush x:Key="Button.MousePressed.BorderBrush" Color="{StaticResource Button.MousePressed.BorderColor}" />
|
||||
|
||||
<!--Storyboards/Timelines-->
|
||||
<!--Button Mouse Over-->
|
||||
<ObjectAnimationUsingKeyFrames x:Key="Button.MouseOver.BackgroundTimeline" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource Control.LightMediumGrayBrush}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames x:Key="Button.MouseOver.BorderTimeline" Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{mbts:BTSColor UI.Button.mouseover_background}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<Storyboard x:Key="Button.MouseOver.Storyboard">
|
||||
<StaticResource ResourceKey="Button.MouseOver.BackgroundTimeline"/>
|
||||
<StaticResource ResourceKey="Button.MouseOver.BorderTimeline"/>
|
||||
</Storyboard>
|
||||
<!--Button Pressed-->
|
||||
<ObjectAnimationUsingKeyFrames x:Key="Button.Pressed.BackgroundTimeline" Storyboard.TargetProperty="Background">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{mbts:BTSColor UI.Button.pressed_background}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<ObjectAnimationUsingKeyFrames x:Key="Button.Pressed.BorderTimeline" Storyboard.TargetProperty="BorderBrush">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{mbts:BTSColor UI.Button.pressed_background}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<Storyboard x:Key="Button.Pressed.Storyboard">
|
||||
<StaticResource ResourceKey="Button.Pressed.BackgroundTimeline"/>
|
||||
<StaticResource ResourceKey="Button.Pressed.BorderTimeline"/>
|
||||
</Storyboard>
|
||||
|
||||
<!--ListBox MouseOver-->
|
||||
<ObjectAnimationUsingKeyFrames x:Key="ListBoxItem.MouseOver.BackgroundTimeline" Storyboard.TargetProperty="(Control.Background)">
|
||||
<DiscreteObjectKeyFrame KeyTime="0" Value="{StaticResource ListBoxItem.MouseOver.Background}"/>
|
||||
</ObjectAnimationUsingKeyFrames>
|
||||
<Storyboard x:Key="ListBoxItem.MouseOver.BackgroundStoryboard">
|
||||
<StaticResource ResourceKey="ListBoxItem.MouseOver.BackgroundTimeline"/>
|
||||
</Storyboard>
|
||||
|
||||
<Style x:Key="StartMenuButton" TargetType="{x:Type Button}">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||||
@@ -325,6 +356,19 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="MenuExpanderButton" TargetType="ToggleButton" BasedOn="{StaticResource MenuExpanderButtonBase}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsChecked" Value="False">
|
||||
<Setter Property="Cursor" Value="ScrollE"/>
|
||||
<Setter Property="ToolTip" Value="Expand Menu"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter Property="Cursor" Value="ScrollW"/>
|
||||
<Setter Property="ToolTip" Value="Collapse Menu"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<!--PlayButtonRed/Blue are commented out bc they are not referenced anywhere.
|
||||
However, RoundPlayButton is a new style, and liable to change; these are good potential alternatives.
|
||||
<Color x:Key="PlayButtonRedColor">#DD4040</Color>
|
||||
@@ -637,6 +681,98 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="LargeMenuControlBase" TargetType="Control">
|
||||
<Setter Property="Background" Value="#F5F5F5"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Stretch"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||
<Setter Property="Padding" Value="6"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="LargeMenuButton" TargetType="Button" BasedOn="{StaticResource LargeMenuControlBase}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border
|
||||
x:Name="Border"
|
||||
CornerRadius="0"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
Background="{TemplateBinding Background}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Height="{TemplateBinding Height}"
|
||||
Width="{TemplateBinding Width}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
>
|
||||
<u:StateManager.Groups>
|
||||
<u:StateGroupsManager AttachToMembers="True">
|
||||
<u:StateDefinitionCollection>
|
||||
<u:MouseStateDefinition MouseSource="{Binding Group.Target.TemplatedParent, RelativeSource={RelativeSource Self}}"/>
|
||||
</u:StateDefinitionCollection>
|
||||
</u:StateGroupsManager>
|
||||
</u:StateManager.Groups>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup Name="MouseStates">
|
||||
<VisualState Name="Normal"/>
|
||||
<VisualState Name="MouseOver" Storyboard="{StaticResource Button.MouseOver.Storyboard}"/>
|
||||
<VisualState Name="Pressed" Storyboard="{StaticResource Button.Pressed.Storyboard}"/>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<ContentPresenter
|
||||
Name="presenter"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
RecognizesAccessKey="True"
|
||||
/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="LargeMenuToggleButton" TargetType="ToggleButton" BasedOn="{StaticResource LargeMenuControlBase}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<Border
|
||||
x:Name="Border"
|
||||
CornerRadius="0"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
Background="{TemplateBinding Background}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Height="{TemplateBinding Height}"
|
||||
Width="{TemplateBinding Width}"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
>
|
||||
<u:StateManager.Groups>
|
||||
<u:StateGroupsManager AttachToMembers="True">
|
||||
<u:StateDefinitionCollection>
|
||||
<u:MouseStateDefinition MouseSource="{Binding Group.Target.TemplatedParent, RelativeSource={RelativeSource Self}}"/>
|
||||
</u:StateDefinitionCollection>
|
||||
</u:StateGroupsManager>
|
||||
</u:StateManager.Groups>
|
||||
<VisualStateManager.VisualStateGroups>
|
||||
<VisualStateGroup Name="MouseStates">
|
||||
<VisualState Name="Normal"/>
|
||||
<VisualState Name="MouseOver" Storyboard="{StaticResource Button.MouseOver.Storyboard}"/>
|
||||
<VisualState Name="Pressed" Storyboard="{StaticResource Button.Pressed.Storyboard}"/>
|
||||
</VisualStateGroup>
|
||||
</VisualStateManager.VisualStateGroups>
|
||||
<ContentPresenter
|
||||
Name="presenter"
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
RecognizesAccessKey="True"
|
||||
/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<ControlTemplate x:Key="BuyButtonTemplate" TargetType="Button">
|
||||
<Border
|
||||
x:Name="Border"
|
||||
|
||||
Reference in new issue
Block a user