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

Adding border to ToggleButton when checked in high-contrast themes #2092

Merged

Conversation

arpitmathur
Copy link
Contributor

@arpitmathur arpitmathur commented Oct 22, 2019

Fixes #1458

5.0 PR: #1976

Description

In non-high contrast themes, when you check a ToggleButton and navigate to another control, we display the checked status by highlighting the button with a lighter shade of the selection color.

We don't follow this behavior in high contrast themes. The text is slightly-depressed upon checking but that is not visually apparent . When the ToggleButton does not have focus, there is a slight border which again, is not apparent.
highcontrastwhitetogglebutton_without_change

In the image above, the 'S', 'C' and 'I' buttons are checked. However, it's barely noticeable that 'S' and 'C' are checked. The checked status of the 'I' button is also not noticeable when it receives focus.

The fix here is to check for a toggle button to be checked when in a high-contrast theme, we then add a border around the button. When a checked button also has keyboard focus, we add a border in the background-color. When the user navigates away, the border color is the same as the selection-color.

In the image below, the 'S', 'C' and 'I' buttons are checked again. Here, it's visually apparent that they are all currently checked.
highcontrastwhitetogglebutton_with_change

In this pull request, relevant changes are in lines 673:693 in Button.xaml, the remaining files are generated off those changes.

Customer Impact

In high contrast themes, when you check a ToggleButton, it is not visually apparent that the ToggleButton has been checked, both when the ToggleButton has keyboard focus and when it does not.

Regression

No. This was discovered during accessibility testing on .Net Core 3.0

Risk - Low

This change only affects the ToggleButton control when HighContrast mode is turned on. The change has been tested well internally.

@arpitmathur arpitmathur added Bug Product bug (most likely) * NO MERGE * metadata: The PR is not ready for merge yet (see discussion for detailed reasons) accessibility mas An issue which is a MAS (Microsoft Accessibility Standards) certification requirement ask-mode labels Oct 22, 2019
@arpitmathur arpitmathur added this to the 3.1 milestone Oct 22, 2019
@ghost ghost added the PR metadata: Label to tag PRs, to facilitate with triage label Oct 22, 2019
@arpitmathur arpitmathur removed the * NO MERGE * metadata: The PR is not ready for merge yet (see discussion for detailed reasons) label Oct 29, 2019
@arpitmathur arpitmathur merged commit 2da6b1e into dotnet:release/3.1 Oct 29, 2019
@arpitmathur arpitmathur deleted the dev/arpit/togglebuttonfocus branch October 29, 2019 18:00
@ghost ghost locked as resolved and limited conversation to collaborators Apr 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accessibility mas An issue which is a MAS (Microsoft Accessibility Standards) certification requirement Bug Product bug (most likely) PR metadata: Label to tag PRs, to facilitate with triage Servicing-approved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants