Skip to content

Commit

Permalink
#2551 add NonActiveWindowTitleColorBrush and NonActiveBorderColorBrus…
Browse files Browse the repository at this point in the history
…h brush keys
  • Loading branch information
punker76 committed Jun 21, 2016
1 parent 50e084e commit ece5532
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
5 changes: 3 additions & 2 deletions MahApps.Metro/Controls/MetroWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ public class MetroWindow : Window
public static readonly DependencyProperty MetroDialogOptionsProperty = DependencyProperty.Register("MetroDialogOptions", typeof(MetroDialogSettings), typeof(MetroWindow), new PropertyMetadata(new MetroDialogSettings()));

public static readonly DependencyProperty WindowTitleBrushProperty = DependencyProperty.Register("WindowTitleBrush", typeof(Brush), typeof(MetroWindow), new PropertyMetadata(Brushes.Transparent));
public static readonly DependencyProperty NonActiveWindowTitleBrushProperty = DependencyProperty.Register("NonActiveWindowTitleBrush", typeof(Brush), typeof(MetroWindow), new PropertyMetadata(Brushes.Gray));
public static readonly DependencyProperty NonActiveBorderBrushProperty = DependencyProperty.Register("NonActiveBorderBrush", typeof(Brush), typeof(MetroWindow), new PropertyMetadata(Brushes.Gray));

public static readonly DependencyProperty GlowBrushProperty = DependencyProperty.Register("GlowBrush", typeof(Brush), typeof(MetroWindow), new PropertyMetadata(null));
public static readonly DependencyProperty NonActiveGlowBrushProperty = DependencyProperty.Register("NonActiveGlowBrush", typeof(Brush), typeof(MetroWindow), new PropertyMetadata(new SolidColorBrush(Color.FromRgb(153, 153, 153)))); // #999999
public static readonly DependencyProperty NonActiveBorderBrushProperty = DependencyProperty.Register("NonActiveBorderBrush", typeof(Brush), typeof(MetroWindow), new PropertyMetadata(Brushes.Gray));
public static readonly DependencyProperty NonActiveWindowTitleBrushProperty = DependencyProperty.Register("NonActiveWindowTitleBrush", typeof(Brush), typeof(MetroWindow), new PropertyMetadata(Brushes.Gray));

public static readonly DependencyProperty IconTemplateProperty = DependencyProperty.Register("IconTemplate", typeof(DataTemplate), typeof(MetroWindow), new PropertyMetadata(null));
public static readonly DependencyProperty TitleTemplateProperty = DependencyProperty.Register("TitleTemplate", typeof(DataTemplate), typeof(MetroWindow), new PropertyMetadata(null));
Expand Down
3 changes: 3 additions & 0 deletions MahApps.Metro/Styles/Colors.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@
<SolidColorBrush x:Key="BlackColorBrush" Color="{DynamicResource BlackColor}" />

<SolidColorBrush x:Key="WindowTitleColorBrush" Color="{DynamicResource AccentColor}" />
<SolidColorBrush x:Key="NonActiveWindowTitleColorBrush" Color="Gray" options:Freeze="True" />
<SolidColorBrush x:Key="NonActiveBorderColorBrush" Color="Gray" options:Freeze="True" />

<SolidColorBrush x:Key="HighlightBrush" Color="{DynamicResource HighlightColor}" />
<SolidColorBrush x:Key="DisabledWhiteBrush" Color="{DynamicResource WhiteColor}" />

Expand Down
2 changes: 2 additions & 0 deletions MahApps.Metro/Styles/VS/Colors.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
<SolidColorBrush x:Key="AccentColorBrush4" options:Freeze="True" Color="{StaticResource AccentColor4}" />

<SolidColorBrush x:Key="WindowTitleColorBrush" options:Freeze="True" Color="{StaticResource AccentColor}" />
<SolidColorBrush x:Key="NonActiveWindowTitleColorBrush" Color="Gray" options:Freeze="True" />
<SolidColorBrush x:Key="NonActiveBorderColorBrush" Color="Gray" options:Freeze="True" />

<SolidColorBrush x:Key="BlackBrush" options:Freeze="True" Color="{StaticResource BlackColor}" />
<SolidColorBrush x:Key="TextBrush" options:Freeze="True" Color="{StaticResource BlackColor}" />
Expand Down
2 changes: 2 additions & 0 deletions MahApps.Metro/Themes/MetroWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -580,6 +580,8 @@
</Setter.Value>
</Setter>
<Setter Property="WindowTitleBrush" Value="{DynamicResource WindowTitleColorBrush}" />
<Setter Property="NonActiveWindowTitleBrush" Value="{DynamicResource NonActiveWindowTitleColorBrush}" />
<Setter Property="NonActiveBorderBrush" Value="{DynamicResource NonActiveBorderColorBrush}" />
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=Icon, Mode=OneWay, Converter={x:Static Converters:IsNullConverter.Instance}}" Value="False">
<Setter Property="IconTemplate">
Expand Down
2 changes: 2 additions & 0 deletions docs/release-notes/1.3.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ MahApps.Metro v1.3.0 bug fix and feature release.
- New dependency property `ShowDialogsOverTitleBar` for `MetroWindow? which allows showing title bar while showing dialogs (fixes #2109) #2534 (@Deadpikle)
- Store/Restore focused element methods which will be used automatically with dialogs (but can be also used explicit) #2532
- Added new methods `ShowModalInputExternal`, `ShowModalLoginExternal` and `ShowModalMessageExternal`. #2518 (@adeniltonbs)
- New brush keys `NonActiveWindowTitleColorBrush` and `NonActiveBorderColorBrush`

# Closed Issues

Expand Down Expand Up @@ -159,3 +160,4 @@ MahApps.Metro v1.3.0 bug fix and feature release.
- #2525 System.Windows.Media.Animation.DoubleAnimation' cannot use default origin value of 'Infinity
- #2552 How to hide flyout title
- #2556 Interact with DialogController from Background Thread (@xxMUROxx)
- #2551 Feature Request: NonActiveWindowTitleColorBrush

0 comments on commit ece5532

Please # to comment.