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

Changes for PR #1600 and PR #1611 #1621

Closed
wants to merge 4 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
31 changes: 30 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,35 @@
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}">

<Style.Triggers>

<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>
9 changes: 8 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="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}" />
<Setter Property="HorizontalContentAlignment"
Value="Center" />
<Setter Property="VerticalContentAlignment"
Expand Down Expand Up @@ -249,19 +249,26 @@
Value=".5" />
</Trigger>
</ControlTemplate.Triggers>

</ControlTemplate>

</Setter.Value>
</Setter>

<Style.Triggers>

<Trigger Property="IsMouseOver"
Value="True">
<Setter Property="Background"
Value="{DynamicResource SemiTransparentWhiteBrush}" />
</Trigger>

<Trigger Property="IsPressed"
Value="True">
<Setter Property="Background"
Value="{DynamicResource HighlightBrush}" />
<Setter Property="Foreground"
Value="White" />
</Trigger>
<Trigger Property="IsEnabled"
Value="false">
Expand Down
20 changes: 20 additions & 0 deletions MahApps.Metro/Styles/VS/Window.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,26 @@
Value="{DynamicResource WindowGlowBrush}" />
<Setter Property="TitleForeground"
Value="{DynamicResource WindowTitleForeground}" />
<Setter Property="WindowMinButtonStyle"
Value="{DynamicResource VSWindowButtonStyle}" />
<Setter Property="WindowMaxButtonStyle"
Value="{DynamicResource VSWindowButtonStyle}" />
<Setter Property="WindowCloseButtonStyle"
Value="{DynamicResource VSWindowButtonStyle}" />
</Style>

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

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

<Style.Triggers>

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

</Style.Triggers>
</Style>

</ResourceDictionary>
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