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

Fix theme based styling for WindowCommands and WindowButtonCommands #3666

Merged

Conversation

punker76
Copy link
Member

@punker76 punker76 commented Oct 29, 2019

Describe the changes you have made to improve this project

  • ThemeManager: Introduce ThemeType. This enumeration helps us to check for light and dark themes.
  • 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.
  • Win10 styles for CleanWindow WindowButtonCommands
    • 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
  • Fix losing focus of opened SplitButton
    • Use PreviewMouseLeftButtonDown instead Click event to allow losing the focus also inside WindowCommands. Set the BorderThickness of the ListBox at the popup to 1 and don't show a focused visual.
  • Add a new SplitButton style for WindowCommands
    • Add a new style MahApps.Styles.SplitButton.Button.WindowCommands
    • Add a new style MahApps.Styles.SplitButton.ButtonArrow.WindowCommands
    • Add a new style MahApps.Styles.SplitButton.WindowCommands which will be used for all SplitButton inside WindowCommands
  • Add a new DropDownButton style for WindowCommands
    • Add a new style MahApps.Styles.DropDownButton.Button.WindowCommands
    • Add a new style MahApps.Styles.DropDownButton.WindowCommands which will be used for all DropDownButton inside WindowCommands
  • Improve overflow WindowCommands

Closed Issues

Closes #3623
Closes #2560
Closes #3447

This enumeration helps us to check for light and dark themes.
…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 punker76 added this to the 2.0.0 milestone 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`
@timunie
Copy link
Collaborator

timunie commented Oct 30, 2019

Good morning @punker76 ,

will this also address #2560 ?

Happy coding
Tim

@punker76
Copy link
Member Author

Good morning @punker76 ,

will this also address #2560 ?

Happy coding
Tim

@timunie Yes, I'll add a styling for the SplitButton.

Use PreviewMouseLeftButtonDown instead Click event to allow losing the focus also inside WindowCommands. Set the BorderThickness of the ListBox at the popup to 1 and don't show a focused visual.
- Add a new style `MahApps.Styles.SplitButton.Button.WindowCommands`
- Add a new style `MahApps.Styles.SplitButton.ButtonArrow.WindowCommands`
- Add a new style `MahApps.Styles.SplitButton.WindowCommands` which will be used for all SplitButton inside  WindowCommands
@punker76
Copy link
Member Author

@timunie

2019-10-30_23h02_02

@timunie
Copy link
Collaborator

timunie commented Oct 31, 2019

Hi @punker76

many thanks it looks really promissing. I think many people will have a benefit of this.

Meanwhile I created a Style for the DropDownButton. Do you want it? If you mark this post with 👍 I will make a PR.
Change_Language

Happy coding
Tim

@punker76
Copy link
Member Author

@timunie 😉

2019-10-31_15h37_39

- Add a new style `MahApps.Styles.DropDownButton.Button.WindowCommands`
- Add a new style `MahApps.Styles.DropDownButton.WindowCommands` which will be used for all DropDownButton inside  WindowCommands
@timunie
Copy link
Collaborator

timunie commented Oct 31, 2019

@punker76 I am just too slow to competite with you. Thanks

Happy updating and happy Halloween
Tim

@punker76
Copy link
Member Author

punker76 commented Nov 2, 2019

@timunie Improved overflow WindowCommands

2019-11-02_18h37_48

@punker76 punker76 merged commit d1cee9c into develop Nov 2, 2019
@punker76 punker76 deleted the 3623_Fix_styling_for_WindowCommands_WindowButtonCommands branch November 2, 2019 18:03
amkuchta pushed a commit to amkuchta/MahApps.Metro that referenced this pull request Nov 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment