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

Try to get the WindowBaseColor in HighContrast mode #132

Merged
merged 2 commits into from Aug 4, 2020

Conversation

punker76
Copy link
Member

@punker76 punker76 commented Jul 26, 2020

Describe the changes you have made to improve this project

  • Use the WIndowBrush for getting the WindowBaseColor in HighContrast mode (Use the System.Drawing GetBrightness to decide between dark and light)

Unit test

  • Static classes can not be mocked. So maybe we can do this without any tests.

Additional context

Reason for the PR comes from MahApps: High contrast theme is not getting applied #3880

Idea

In order to fix another issue with HighContrast mode we should first search for an existing theme without an accent color. Because normally there is only one HighContrast theme (like in UWP).

So an app with custom themes should only have two themes, one for light and one for dark if no other will be found.

@punker76 punker76 requested a review from batzen July 26, 2020 22:05
@batzen
Copy link
Member

batzen commented Aug 1, 2020

I am not sure if we should do it this way.
GetWindowsBaseColor should do what it's name says. If we check for high contrast there and return something different it's not the windows base color anymore.
In which way does this fix the linked issue?

In order to fix another issue with HighContrast mode we should first search for an existing theme without an accent color. Because normally there is only one HighContrast theme (like in UWP).

Windows itself has different high contrast themes doesn't it? The settings app exposes 4 different high contrast themes on my machine.
If a developer chooses to provide high contrast themes and only want to provide two (one dark, one light) and does not want different ones for different accent colors they should just turn off accent color sync, shouldn't they?

@batzen
Copy link
Member

batzen commented Aug 1, 2020

If a developer chooses to provide high contrast themes and only want to provide two (one dark, one light) and does not want different ones for different accent colors they should just turn off accent color sync, shouldn't they?

We could, and maybe really should, check if we find a theme that has high contrast and the accent color and if we don't find any just choose a high contrast theme without the accent color. But we'd need some way to express this option. Not sure where and how we should add that.

@batzen batzen merged commit 50ee015 into develop Aug 4, 2020
@punker76 punker76 deleted the features/HighContrast-Window-BaseColor branch August 5, 2020 09:09
@punker76 punker76 added this to the 4.4.0 milestone Oct 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants