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

Dark Themes use LightMinButtonStyle, LightMaxButtonStyle and LightCloseButtonStyle for WindowButtonCommands #3623

Closed
Nightro opened this issue Oct 3, 2019 · 0 comments · Fixed by #3666
Assignees
Labels
Milestone

Comments

@Nightro
Copy link

Nightro commented Oct 3, 2019

Describe the bug
Window button commands (minimize, maximize, close) are all using light button styles (MahApps.Styles.Button.MetroWindow.Light) instead of the dark (MahApps.Styles.Button.MetroWindow.Dark)

To Reproduce
Steps to reproduce the behavior:

  1. Apply a Dark theme in App.xaml (e.g. `)
  2. Ensure the main window is of type MetroWindow and overrides no styles
  3. Run and observe that the styles are incorrect for the WindowCommandButtons

Expected behavior
Dark themes should use dark styles for all controls (including WindowCommandButtons).

Screenshots
Without my workaround:
image

Inspecting PART_Min (button):
image

With my workaround:
image

Inspecting PART_Min (button):
image

Environment(please complete the following information):

  • MahApps.Metro version 2.0.0-alpha0490
  • OS: Win10 Home x64 1903
  • Visual Studio 2017 15.8.6
  • .NET Framework 4.8.03752 (targeting 4.6.1)

Workaround
I am able to work around this issue by adding the following to my App.xaml for now:

<Style TargetType="{x:Type Controls:WindowButtonCommands}" BasedOn="{StaticResource {x:Type Controls:WindowButtonCommands}}">
   <Setter Property="LightMinButtonStyle" Value="{StaticResource MahApps.Styles.Button.MetroWindow.Dark}" />
   <Setter Property="LightMaxButtonStyle" Value="{StaticResource MahApps.Styles.Button.MetroWindow.Dark}" />
   <Setter Property="LightCloseButtonStyle" Value="{StaticResource MahApps.Styles.Button.MetroWindow.Dark}" />
</Style>
@punker76 punker76 added the Bug label Oct 29, 2019
@punker76 punker76 self-assigned this Oct 29, 2019
@punker76 punker76 added this to the 2.0.0 milestone Oct 29, 2019
punker76 added a commit that referenced this issue Oct 29, 2019
This enumeration helps us to check for light and dark themes.
punker76 added a commit that referenced this issue Oct 29, 2019
…ndowButtonCommands

- Add new brush `MahApps.Brushes.WindowButtonCommands.HoverBackground`
- Add new style `MahApps.Styles.WindowCommands.Base`
- Derive style `MahApps.Styles.WindowCommands.Clean` from `MahApps.Styles.WindowCommands.Base`
- Add new style `MahApps.Styles.WindowButtonCommands.Base`
- Derive style `MahApps.Styles.WindowButtonCommands.Clean` from `MahApps.Styles.WindowButtonCommands.Base`
- `MahApps.Styles.MetroWindow.Clean` style doesn't set the `OverrideDefaultWindowCommandsBrush` to `MahApps.Brushes.Black` (it's not necessary anymore)
- Add new styles `MahApps.Styles.Button.CleanWindow.Light` and `MahApps.Styles.Button.CleanWindow.Dark`
- Fix disabled brush at `WindowCommands` and `WindowButtonCommands`
- Set the pressed background of the Min/Max/Restore/Close buttons to `MahApps.Brushes.AccentBase` and the foreground to `MahApps.Brushes.IdealForeground`
- Do not set the theme for WindowCommands and WindowButtonCommands by the Foreground. Instead look for the current theme of the application, window or flyout.
punker76 added a commit that referenced this issue Oct 29, 2019
This enumeration helps us to check for light and dark themes.
punker76 added a commit that referenced this issue Oct 29, 2019
…ndowButtonCommands

- Add new brush `MahApps.Brushes.WindowButtonCommands.HoverBackground`
- Add new style `MahApps.Styles.WindowCommands.Base`
- Derive style `MahApps.Styles.WindowCommands.Clean` from `MahApps.Styles.WindowCommands.Base`
- Add new style `MahApps.Styles.WindowButtonCommands.Base`
- Derive style `MahApps.Styles.WindowButtonCommands.Clean` from `MahApps.Styles.WindowButtonCommands.Base`
- `MahApps.Styles.MetroWindow.Clean` style doesn't set the `OverrideDefaultWindowCommandsBrush` to `MahApps.Brushes.Black` (it's not necessary anymore)
- Add new styles `MahApps.Styles.Button.CleanWindow.Light` and `MahApps.Styles.Button.CleanWindow.Dark`
- Fix disabled brush at `WindowCommands` and `WindowButtonCommands`
- Set the pressed background of the Min/Max/Restore/Close buttons to `MahApps.Brushes.AccentBase` and the foreground to `MahApps.Brushes.IdealForeground`
- Do not set the theme for WindowCommands and WindowButtonCommands by the Foreground. Instead look for the current theme of the application, window or flyout.
punker76 added a commit that referenced this issue Oct 29, 2019
- Add new style `MahApps.Styles.Button.CleanWindow.Close.Light.Win10`
- Add new style `MahApps.Styles.Button.CleanWindow.Close.Dark.Win10`
- Add new style `MahApps.Styles.WindowButtonCommands.Clean.Win10`
amkuchta pushed a commit to amkuchta/MahApps.Metro that referenced this issue Nov 19, 2019
This enumeration helps us to check for light and dark themes.
amkuchta pushed a commit to amkuchta/MahApps.Metro that referenced this issue Nov 19, 2019
… and WindowButtonCommands

- Add new brush `MahApps.Brushes.WindowButtonCommands.HoverBackground`
- Add new style `MahApps.Styles.WindowCommands.Base`
- Derive style `MahApps.Styles.WindowCommands.Clean` from `MahApps.Styles.WindowCommands.Base`
- Add new style `MahApps.Styles.WindowButtonCommands.Base`
- Derive style `MahApps.Styles.WindowButtonCommands.Clean` from `MahApps.Styles.WindowButtonCommands.Base`
- `MahApps.Styles.MetroWindow.Clean` style doesn't set the `OverrideDefaultWindowCommandsBrush` to `MahApps.Brushes.Black` (it's not necessary anymore)
- Add new styles `MahApps.Styles.Button.CleanWindow.Light` and `MahApps.Styles.Button.CleanWindow.Dark`
- Fix disabled brush at `WindowCommands` and `WindowButtonCommands`
- Set the pressed background of the Min/Max/Restore/Close buttons to `MahApps.Brushes.AccentBase` and the foreground to `MahApps.Brushes.IdealForeground`
- Do not set the theme for WindowCommands and WindowButtonCommands by the Foreground. Instead look for the current theme of the application, window or flyout.
amkuchta pushed a commit to amkuchta/MahApps.Metro that referenced this issue Nov 19, 2019
- Add new style `MahApps.Styles.Button.CleanWindow.Close.Light.Win10`
- Add new style `MahApps.Styles.Button.CleanWindow.Close.Dark.Win10`
- Add new style `MahApps.Styles.WindowButtonCommands.Clean.Win10`
amkuchta pushed a commit to amkuchta/MahApps.Metro that referenced this issue Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants