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

use IdealForegroundColorBrush in title bar elements #1611

Merged
Merged
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
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