-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
High Contrast support for Graphing Calculator #878
High Contrast support for Graphing Calculator #878
Conversation
</ResourceDictionary> | ||
<ResourceDictionary x:Key="Dark"> | ||
<CornerRadius x:Key="TopButtonCornerRadius">4,4,0,0</CornerRadius> | ||
<CornerRadius x:Key="BottomButtonCornerRadius">0,0,4,4</CornerRadius> | ||
<CornerRadius x:Key="LeftButtonCornerRadius">4,0,0,4</CornerRadius> | ||
<CornerRadius x:Key="RightButtonCornerRadius">0,4,4,0</CornerRadius> | ||
<Color x:Key="GrapherAxesColor">White</Color> | ||
<Color x:Key="GrapherBackground">Black</Color> | ||
</ResourceDictionary> | ||
<ResourceDictionary x:Key="HighContrast"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HighContrast [](start = 51, length = 12)
I'm not seeing things in the graph change when we go directly from high contrast black to high contrast white. I'm not sure if this is our bug or a UWP bug though as our handler for background change doesn't get hit either.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be related to an issue I experienced before where the high contrast colors seem to be equal to each other when switching between the modes. I had a work around where I set them to transparent inbetween, not sure if it would help here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue was because we used <StaticResource x:Key... />
so the color wasn't updated when the system switches from a High Contrast theme to another High Contrast theme. Unfortunately <ThemeResource x:Key
don't work. I've found a workaround: instead of setting the color in the ResourceDictionary, I now create a new Style, this one being able to host a {ThemeResource}
.
@joseartrivera This issue was different, it was because when you switch from a High Contrast mode to another one, the system only updates the Color, not the Brush, meaning GraphingControl which used the brush wasn't able to detect that the color change. This doesn't happen with other controls because they use the color of the brush we pass, not the case of GraphControl which create a copy of the color.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
played around with this and it looks good.
Description of the changes:
Also:
Note: we want to keep the graph white background, black lines with dark theme for the moment.
How changes were validated: