Skip to content

Commit

Permalink
Merge pull request #1611 from thoemmi/use-IdealForegroundColorBrush-i…
Browse files Browse the repository at this point in the history
…n-title

use IdealForegroundColorBrush in title bar elements
  • Loading branch information
punker76 committed Oct 26, 2014
2 parents f5fe548 + ecc9e76 commit 1e49915
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions MahApps.Metro/Themes/MetroWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
</Setter.Value>
</Setter>
<Setter Property="TitleForeground"
Value="White" />
Value="{DynamicResource IdealForegroundColor}" />
<Setter Property="Template"
Value="{StaticResource WindowTemplateKey}" />
<Setter Property="TitleTemplate">
Expand Down Expand Up @@ -325,6 +325,8 @@
<ControlTemplate.Resources>
<ResourceDictionary>
<Style TargetType="{x:Type Button}">
<Setter Property="Foreground"
Value="{DynamicResource IdealForegroundColor}"/>
<Setter Property="Background"
Value="{DynamicResource TransparentWhiteBrush}" />
<Setter Property="HorizontalContentAlignment"
Expand Down Expand Up @@ -376,7 +378,7 @@
<Trigger Property="IsEnabled"
Value="false">
<Setter Property="Foreground"
Value="#ADADAD" />
Value="{DynamicResource IdealForegroundColorBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand All @@ -386,7 +388,7 @@
<DataTrigger Binding="{Binding ShowTitleBar, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}}"
Value="True">
<Setter Property="Foreground"
Value="White" />
Value="{DynamicResource IdealForegroundColorBrush}" />
</DataTrigger>
</Style.Triggers>
</Style>
Expand Down Expand Up @@ -448,7 +450,7 @@
<DataTrigger Binding="{Binding ShowTitleBar, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}}"
Value="True">
<Setter Property="Foreground"
Value="White" />
Value="{DynamicResource IdealForegroundColorBrush}" />
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand Down Expand Up @@ -502,7 +504,7 @@
Focusable="False"
Height="{Binding TitlebarHeight, Mode=OneWay, RelativeSource={RelativeSource AncestorType=Controls:MetroWindow}}"
Style="{Binding WindowMinButtonStyle, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}}"
Foreground="{TemplateBinding Foreground}"
Foreground="{DynamicResource IdealForegroundColorBrush}"
ToolTip="{Binding Minimize, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:WindowButtonCommands}}}">
<Button.Visibility>
<MultiBinding Converter="{x:Static conv:ResizeModeMinMaxButtonVisibilityConverter.Instance}"
Expand All @@ -517,14 +519,14 @@
</Button.Visibility>
<Path Data="F1M0,6L0,9 9,9 9,6 0,6z"
SnapsToDevicePixels="True"
Fill="{TemplateBinding Foreground}" />
Fill="{DynamicResource IdealForegroundColorBrush}" />
</Button>

<Button x:Name="PART_Max"
Focusable="False"
Height="{Binding TitlebarHeight, Mode=OneWay, RelativeSource={RelativeSource AncestorType=Controls:MetroWindow}}"
Style="{Binding WindowMaxButtonStyle, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}}"
Foreground="{TemplateBinding Foreground}"
Foreground="{DynamicResource IdealForegroundColorBrush}"
ToolTip="{Binding Maximize, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:WindowButtonCommands}}}">
<Button.Visibility>
<MultiBinding Converter="{x:Static conv:ResizeModeMinMaxButtonVisibilityConverter.Instance}"
Expand All @@ -538,20 +540,20 @@
</MultiBinding>
</Button.Visibility>
<Path x:Name="MaxPath" SnapsToDevicePixels="True"
Fill="{TemplateBinding Foreground}" >
Fill="{DynamicResource IdealForegroundColorBrush}" >
</Path>
</Button>

<Button x:Name="PART_Close"
Focusable="False"
Height="{Binding TitlebarHeight, Mode=OneWay, RelativeSource={RelativeSource AncestorType=Controls:MetroWindow}}"
Style="{Binding WindowCloseButtonStyle, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}}"
Foreground="{TemplateBinding Foreground}"
Foreground="{DynamicResource IdealForegroundColorBrush}"
ToolTip="{Binding Close, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:WindowButtonCommands}}}"
Visibility="{Binding ShowCloseButton, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:MetroWindow}}, Converter={StaticResource BooleanToVisibilityConverter}}">
<Path Data="F1M0,0L2,0 5,3 8,0 10,0 6,4 10,8 8,8 5,5 2,8 0,8 4,4 0,0z"
SnapsToDevicePixels="True"
Fill="{TemplateBinding Foreground}" />
Fill="{DynamicResource IdealForegroundColorBrush}" />
</Button>
</StackPanel>
<ControlTemplate.Triggers>
Expand Down

0 comments on commit 1e49915

Please sign in to comment.