Skip to content

Commit

Permalink
Changes for PR #1600 and PR #1611
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelspezi authored and flagbug committed Nov 21, 2014
1 parent 7c151b9 commit bdf5727
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 9 deletions.
37 changes: 36 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 @@ -239,6 +238,7 @@
<Style TargetType="{x:Type Controls:MetroWindow}"
BasedOn="{StaticResource {x:Type Controls:MetroWindow}}"
x:Key="CleanWindowStyleKey">

<Setter Property="ShowTitleBar"
Value="True" />
<Setter Property="MinWidth"
Expand All @@ -249,6 +249,41 @@
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>
4 changes: 3 additions & 1 deletion MahApps.Metro/Styles/Controls.Buttons.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,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 @@ -262,6 +262,8 @@
Value="True">
<Setter Property="Background"
Value="{DynamicResource HighlightBrush}" />
<Setter Property="Foreground"
Value="White" />
</Trigger>
<Trigger Property="IsEnabled"
Value="false">
Expand Down
12 changes: 5 additions & 7 deletions MahApps.Metro/Themes/MetroWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,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 @@ -522,14 +521,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 @@ -543,20 +541,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 Down

0 comments on commit bdf5727

Please sign in to comment.