-
Notifications
You must be signed in to change notification settings - Fork 683
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
Improve theming of TabView in High Contrast mode #1663
Improve theming of TabView in High Contrast mode #1663
Conversation
Thanks, the GIFs included are awesome! Adding @YuliKl as our resident accessibility person to help review the proposed changes. |
/azp run |
Pull request contains merge conflicts. |
b006bb5
to
7770f0e
Compare
@jtippet thank you for all this work this is awesome! One high-level piece of feedback - by convention, we usually keep a resource mapped to the same brush in all themes. So for example, I would expect TabViewBackground to map to SystemControlBackgroundBaseLowBrush in all three themes. If SystemControlBackgroundBaseLowBrush isn't the right brush in, for example, HC, I would try to find a different brush that resolved to the right colors in all themes. I'll try to come up with some concrete suggestions for how to keep this uniform mapping. |
In a word, yes. HC is all about end-user customization - letting users choose the combination of potentially unconventional colors that works best for their vision. HC overrides the aesthetic choices made by the app developer and puts the user in charge.
I strongly advise against doing anything automatic along these lines. Inevitably the magic is complicated to code and doesn't meet the needs of a sufficient percentage of customers.
Indeed 😊 I vote for the "new option" |
Okay, that makes sense. I've implemented additional code so that, when HC mode is enabled, we forcibly set a contrasting background behind anything that we draw text or glyphs on. When HC is not enabled, we let the app developer shoot themselves in the foot, if they insist. (That much is unchanged from the code currently in master.) Here's the same example as above, but now with a LightPink background on the TabView:
As you can see, dark theme is a readability disaster, as the developer requested, but we saved the day in HC Black. In HC mode, the LightPink gutter is still visible around the edges, but it doesn't intrude into the tabs or buttons.
Once we've settled on the final appearance we want, I'll go shopping for brushes that satisfy this convention while delivering the correct appearance. Let me know if there's any further changes to the appearance we want, e.g., if you told me that the [<] and [>] buttons look a bit out-of-place in HC mode and we should change them too while we're at it... I'd put up very little resistance to that.
I'm not going to do this in this PR, since that would change the API surface, and I'm trying to have this PR be "merely" theme changes. But if you think this is a worthy feature, let's open a separate issue to track it, and I'd be happy to take a swing at implementing it. |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
These GIFs are awesome, thanks for making them it really makes the code much easier to review |
Looks like the change is crashing the test app. |
@jtippet are these test failures something you will be able to take a look at in order to get this change merged in? |
Yes, sorry for going dark over the US holiday. The test failures don't repro on my local machine, and I wasn't able to find any great details in the AZP logs, so my best theory is that they're some sort of problem loading the code downlevel. I'm going to set up a downlevel VM and try to repro them, but that chore is going to consume enough time that I'm going to have to save it for the weekend. |
@jtippet Do you still plan to address the test failures, or would you like to see if someone from the team can help? |
f124fe8
to
a61c263
Compare
Thanks for the offer of help. I eventually figured out the problem (I was missing some ResourceDictionary entries). I've pushed a new update, and also rebased on HEAD again. Can you re-run the tests? |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Sigh, well that's progress - we're down to 2 test failures. I'll take another look. |
Okay I went through the TabView test cases, and sorted out the failures. I realized that I had assumed most of the tests were just flaky, but actually they were failing on my machine due to the DPI. Once I toggled back to 96 DPI, I was able to repro the exact same set of failures as AZP. I suggest adding a note to the developer guide that you have to run the tests at 96 DPI, and/or a warning to each test case that's known to be thusly brittle, since this wasn't obvious to me.
|
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Good suggestion! thanks for the work to fix the tests up. |
This exciting new error looks like an infrastructure problem? The test automation script is reporting a powershell syntax error because $versionedMasters is null.
The step that had failed before now passes:
|
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
The latest failure is due to a newly introduced unreliable test. I've made a PR to disable it #1770. Once that PR is merged in we should pull the changed into your branch and rerun the PR gates. Sorry for the annoyance! |
… into user/jtippet/tabview_highcontrast
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
<StaticResource x:Key="TabViewButtonBackgroundPressed" ResourceKey="SystemControlBackgroundListMediumBrush" /> | ||
<StaticResource x:Key="TabViewButtonBackgroundPointerOver" ResourceKey="SystemControlBackgroundListLowBrush" /> | ||
<StaticResource x:Key="TabViewButtonBackgroundDisabled" ResourceKey="SystemControlTransparentBrush" /> | ||
<StaticResource x:Key="TabViewButtonBackgroundActiveTab" ResourceKey="SystemControlTransparentBrush" /> |
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.
I may be overthinking, but the "ActiveTab" part of this resource name doesn't sound quite right to me. @MikeHillberg, what do you think?
<StaticResource x:Key="TabViewItemHeaderBackgroundSelected" ResourceKey="SystemControlHighlightChromeHighBrush" /> | ||
<StaticResource x:Key="TabViewItemHeaderBackgroundPointerOver" ResourceKey="SystemControlHighlightChromeHighBrush" /> |
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.
I'm not a fan of Edge (chromium) approach of having the selected tab look the same as the tab being hovered over. I think Edge (spartan) got the accessibility right in that the hovered tab gains a border but not a full background change.
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.
That's a fair point, and I'm also slightly uncomfortable with the loss of information of the selected-tab looking the same as a hovered-tab. However, the border is exposed programmatically, so a developer could set one too. It'll take some finesse, I think, to insert a border without messing up apps that also try to set a border.
As to what this should look like, I'll present a few options. In each of these mockups, the first tab is active, the second tab is hovered, and the third is idle.
Border | Mock-up |
---|---|
4px all sides | |
2px all sides | |
4px top | |
4px top and sides | |
4px bottom |
I'm no UI designer, so I don't hold my opinion with any great fondness, but I tend to think that the "4px all sides" option looks the most consistent with the rest of the OS, although the "4px bottom" option is actually kind of cool to interact with.
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.
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.
+1 to 2px on all sides. 4px on all sides seems overly chunky to me, and the other options seem inconsistent with the platform all-up.
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.
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.
Agree with the 2px all sides feeling best.
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
TabView is ugly when High Contrast (HC) mode is enabled. This repros with Windows Desktop build 18363.476 and MUX compiled from a recent master (1a62591).
I've made a few changes to make the TabView look better, using Edge Chromium as a reference. Here's a hypnotic compilation of screenshots. TabView "now" is the current HEAD, and TabView "new" illustrates my proposed changes.
Summary of changes: