Skip to content
New issue

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

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

Already on GitHub? # to your account

Small graphical changes for the CleanWindow #1600

Closed
wants to merge 2 commits into from
Closed
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
35 changes: 34 additions & 1 deletion MahApps.Metro/Styles/Clean/CleanWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@
Grid.Column="4"
Grid.RowSpan="2"
VerticalAlignment="Top"
Foreground="{DynamicResource BlackColorBrush}"
Height="{Binding TitlebarHeight, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}" />

<!-- the main window content -->
Expand Down Expand Up @@ -249,6 +248,40 @@
Value="{DynamicResource BlackBrush}" />
<Setter Property="OverrideDefaultWindowCommandsBrush"
Value="{DynamicResource BlackBrush}" />
<Setter Property="WindowMinButtonStyle"
Value="{DynamicResource CleanWindowButtonStyle}" />
<Setter Property="WindowMaxButtonStyle"
Value="{DynamicResource CleanWindowButtonStyle}" />
<Setter Property="WindowCloseButtonStyle"
Value="{DynamicResource CleanCloseWindowButtonStyle}" />
</Style>

<Style x:Key="CleanWindowButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource MetroWindowButtonStyle}">

<Setter Property="Foreground" Value="{DynamicResource BlackBrush}" />

<Style.Triggers>

<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#EEEEEE" />
</Trigger>

<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="{DynamicResource AccentColorBrush}" />
<Setter Property="Foreground" Value="White" />
</Trigger>

</Style.Triggers>
</Style>

<Style x:Key="CleanCloseWindowButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource CleanWindowButtonStyle}">
<Style.Triggers>

<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#EB2F2F" />
</Trigger>

</Style.Triggers>
</Style>

</ResourceDictionary>
3 changes: 2 additions & 1 deletion MahApps.Metro/Styles/Controls.Buttons.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@
<Setter Property="Background"
Value="{DynamicResource TransparentWhiteBrush}" />
<Setter Property="Foreground"
Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
Value="{DynamicResource IdealForegroundColorBrush}" />
<Setter Property="HorizontalContentAlignment"
Value="Center" />
<Setter Property="VerticalContentAlignment"
Expand Down Expand Up @@ -261,6 +261,7 @@
Value="True">
<Setter Property="Background"
Value="{DynamicResource HighlightBrush}" />
<Setter Property="Foreground" Value="White" />
</Trigger>
<Trigger Property="IsEnabled"
Value="false">
Expand Down
24 changes: 12 additions & 12 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,6 @@
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}"
ToolTip="{Binding Minimize, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:WindowButtonCommands}}}">
<Button.Visibility>
<MultiBinding Converter="{x:Static conv:ResizeModeMinMaxButtonVisibilityConverter.Instance}"
Expand All @@ -517,14 +518,13 @@
</Button.Visibility>
<Path Data="F1M0,6L0,9 9,9 9,6 0,6z"
SnapsToDevicePixels="True"
Fill="{TemplateBinding Foreground}" />
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=Button}}" />
</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}"
ToolTip="{Binding Maximize, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Controls:WindowButtonCommands}}}">
<Button.Visibility>
<MultiBinding Converter="{x:Static conv:ResizeModeMinMaxButtonVisibilityConverter.Instance}"
Expand All @@ -538,20 +538,20 @@
</MultiBinding>
</Button.Visibility>
<Path x:Name="MaxPath" SnapsToDevicePixels="True"
Fill="{TemplateBinding Foreground}" >
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=Button}}" >
</Path>
</Button>

<Button x:Name="PART_Close"
Focusable="False"
RenderOptions.EdgeMode="Aliased"
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}"
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"
<Path Data="M 10.009,1.704 L 8.331,0.026 5.03,3.327 1.703,0 0,1.704 3.326,5.031 0.025,8.332 1.703,10.009 5.004,6.708 8.305,10.009 10.009,8.305 6.708,5.005"
SnapsToDevicePixels="True"
Fill="{TemplateBinding Foreground}" />
Fill="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType=Button}}" />
</Button>
</StackPanel>
<ControlTemplate.Triggers>
Expand All @@ -578,4 +578,4 @@
</DataTrigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
</ResourceDictionary>