Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AccentedSquareButton, IdealForegroundColor key and hover-effect for Dialog buttons. #845

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion MahApps.Metro/Controls/Dialogs/BaseMetroDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public BaseMetroDialog(MetroWindow owningWindow)
break;
case MetroDialogColorScheme.Accented:
this.SetResourceReference(BackgroundProperty, "AccentColorBrush");
this.SetResourceReference(ForegroundProperty, "WhiteColorBrush");
this.SetResourceReference(ForegroundProperty, "IdealForegroundColorBrush");
break;
}
}
Expand Down
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Amber.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">Black</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Blue.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">White</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Brown.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">White</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Cobalt.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">White</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Crimson.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">White</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Cyan.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">Black</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Emerald.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">White</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Green.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">White</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Indigo.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">White</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Lime.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,8 @@

<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">Black</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Magenta.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">White</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Mauve.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">White</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Olive.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">Black</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Orange.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">Black</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Pink.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">Black</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Purple.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">White</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Red.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">Black</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Sienna.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">White</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Steel.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">Black</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Teal.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">Black</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Violet.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">White</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Accents/Yellow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
<SolidColorBrush x:Key="CheckmarkFill" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="RightArrowFill" Color="{StaticResource AccentColor}" />

<Color x:Key="IdealForegroundColor">White</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}"/>

</ResourceDictionary>
125 changes: 125 additions & 0 deletions MahApps.Metro/Styles/Controls.Buttons.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -456,6 +456,131 @@
</Setter.Value>
</Setter>
</Style>

<Style x:Key="AccentedSquareButtonStyle"
TargetType="{x:Type Button}">
<Setter Property="MinHeight"
Value="25" />
<Setter Property="FontFamily"
Value="{DynamicResource DefaultFont}" />
<Setter Property="FontWeight"
Value="SemiBold" />
<Setter Property="Background"
Value="{DynamicResource GrayBrush10}" />
<Setter Property="BorderBrush"
Value="{DynamicResource BlackBrush}" />
<Setter Property="Foreground"
Value="{DynamicResource IdealForegroundColorBrush}" />
<Setter Property="Padding"
Value="5,6" />
<Setter Property="BorderThickness"
Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Grid>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
<VisualState x:Name="MouseOver">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="MouseOverBorder">
<EasingDoubleKeyFrame KeyTime="0"
Value="1" />
</DoubleAnimationUsingKeyFrames>
<ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)"
Storyboard.TargetName="MouseOverBorder">
<EasingThicknessKeyFrame KeyTime="0"
Value="2" />
</ThicknessAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Pressed">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="PressedBorder">
<EasingDoubleKeyFrame KeyTime="0"
Value="1" />
</DoubleAnimationUsingKeyFrames>
<ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)"
Storyboard.TargetName="MouseOverBorder">
<EasingThicknessKeyFrame KeyTime="0"
Value="0" />
</ThicknessAnimationUsingKeyFrames>
<ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.BorderThickness)"
Storyboard.TargetName="PressedBorder">
<EasingThicknessKeyFrame KeyTime="0"
Value="2" />
</ThicknessAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Disabled">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
Storyboard.TargetName="DisabledVisualElement">
<SplineDoubleKeyFrame KeyTime="0"
Value="0.7" />
</DoubleAnimationUsingKeyFrames>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
Storyboard.TargetName="contentPresenter">
<EasingDoubleKeyFrame KeyTime="0"
Value="0.3" />
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
<VisualStateGroup x:Name="FocusStates">
<VisualState x:Name="Focused" />
<VisualState x:Name="Unfocused" />
</VisualStateGroup>
<VisualStateGroup x:Name="ValidationStates">
<VisualState x:Name="Valid" />
<VisualState x:Name="InvalidFocused" />
<VisualState x:Name="InvalidUnfocused" />
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border x:Name="Background"
BorderBrush="{DynamicResource BlackBrush}"
BorderThickness="2"
Background="{DynamicResource AccentColorBrush}" />
<Rectangle x:Name="DisabledVisualElement"
Fill="{DynamicResource ControlsDisabledBrush}"
IsHitTestVisible="false"
Opacity="0" />
<Border x:Name="MouseOverBorder"
Background="{DynamicResource GrayBrush8}"
Opacity="0" />
<Border x:Name="PressedBorder"
Background="{DynamicResource BlackBrush}"
Opacity="0"
BorderBrush="{DynamicResource BlackBrush}" />
<ContentPresenter x:Name="contentPresenter"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content, Converter={StaticResource ToLowerConverter}}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
RecognizesAccessKey="True"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
OpacityMask="{x:Null}" />
</Grid>

<ControlTemplate.Triggers>
<Trigger Property="IsPressed"
Value="true">
<Setter Property="Foreground"
Value="{DynamicResource WhiteBrush}" />
</Trigger>
<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="Foreground"
Value="Black" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style x:Key="MetroCircleToggleButtonStyle"
TargetType="{x:Type ToggleButton}">
Expand Down
Loading