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

Make Terminal look great in High Contrast #6833

Merged

Conversation

jtippet
Copy link
Contributor

@jtippet jtippet commented Jul 8, 2020

Summary of the Pull Request

This PR enables ApplicationHighContrastAdjustment::None. Doing this disables a set of mitigations in XAML designed to band-aid apps that were never explicitly designed for High Contrast (HC) modes. Terminal now has full control of and responsibility for its appearance in HC mode. This allows Terminal to look a lot better.

PR Checklist

  • Closes UI is broken in system high contrast mode #5360
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Documentation updated. If checked, please file a pull request on our docs repo and link it here: #xxx
  • Schema updated.
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

Detailed Description of the Pull Request / Additional comments

On paper, we should be able to set HighContrastAdjustment="None" on the <Application> element. But that doesn't have any effect. I don't know if this is a bug in <Toolkit:XamlApplication> or somewhere else. So instead I set the property in codebehind, which is not as ideal, but does at least work. I'd love to a way to move this into App.xaml.

The Find box had a couple stray styles to override the ToggleButton's foreground color. With backplating removed, these styles became actively harmful (white foreground on highlight color background), so I just removed them. The built-in style for ToggleButton is perfect as-is.

Validation Steps Performed

Vicariously validate via viewing various vivid videos.

High Contrast White:
finalwhite

High Contrast Dark:
finalblack

The previous appearance, prior to this PR, for comparison purposes:
finalold

@mimi89999 this is the PR you've been waiting for ;) Thanks for reporting the HC bugs, and please do keep leaning on apps to make them look great in HC mode.

@ghost ghost added Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. labels Jul 8, 2020
@mimi89999
Copy link

Thanks a lot for your work on this. I'm waiting for this to land in master for the pipeline not being a PR one to test the artifacts 😄

Copy link
Member

@zadjii-msft zadjii-msft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this!

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, I am neither surprised nor horrified to learn that there is a global magic flag that is set to "do weird stuff to my application" mode by default.

Thank you for doing this. We really needed it.

@jtippet
Copy link
Contributor Author

jtippet commented Jul 8, 2020

In general, I am neither surprised nor horrified to learn that there is a global magic flag that is set to "do weird stuff to my application" mode by default.

Console defaults to CP_OEM streams or something equally vile ��

@DHowett
Copy link
Member

DHowett commented Jul 8, 2020

I feel very seen right now
😁

@DHowett
Copy link
Member

DHowett commented Jul 8, 2020

@msftbot merge this in 5 minutes

@ghost ghost added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jul 8, 2020
@ghost
Copy link

ghost commented Jul 8, 2020

Hello @DHowett!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

  • I won't merge this pull request until after the UTC date Wed, 08 Jul 2020 19:02:14 GMT, which is in 5 minutes

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

@DHowett DHowett added AutoMerge Marked for automatic merge by the bot when requirements are met and removed AutoMerge Marked for automatic merge by the bot when requirements are met labels Jul 8, 2020
@ghost
Copy link

ghost commented Jul 8, 2020

Hello @DHowett!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 8 hours, a condition that will be fulfilled in about 4 minutes. No worries though, I will be back when the time is right! 😉

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@DHowett DHowett removed the AutoMerge Marked for automatic merge by the bot when requirements are met label Jul 8, 2020
@DHowett DHowett merged commit 182a3bb into microsoft:master Jul 8, 2020
ghost pushed a commit that referenced this pull request Jul 14, 2020
<!-- Enter a brief description/summary of your PR here. What does it fix/what does it change/how was it tested (even manually, if necessary)? -->
## Summary of the Pull Request
Update the Palette to be readable under High Contrast mode

<!-- Other than the issue solved, is this relevant to any other issues/existing PRs? --> 
## References
Regressed in #6833

<!-- Please review the items on the PR checklist before submitting-->
## PR Checklist
* [X] Closes #6892
* [X] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA
* [ ] Tests added/passed
* [ ] Documentation updated. If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/terminal) and link it here: #xxx
* [ ] Schema updated.
* [X] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #6892

<!-- Provide a more detailed description of the PR, other things fixed or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
I pulled the styling of the KeyChord text into a Style, so we can give it a different style under High Contrast.  Under HC, I just left all the colors at their default, so ListView can do its thing.  (IMHO, the HC style now looks better than the non-HC mode, but maybe I'm biased ;) )

<!-- Describe how you validated the behavior. Add automated tests wherever possible, but list manual validation steps taken as well -->
## Validation Steps Performed
| | Old | New |
|---|:---:|:---:|
| Light | ![light](https://user-images.githubusercontent.com/10259764/87398203-6b8f9a80-c56a-11ea-99d0-2eeefcfea269.png) | ![newlight](https://user-images.githubusercontent.com/10259764/87399212-e3aa9000-c56b-11ea-9e94-c8fae8825cd1.png) |
| Dark | ![dark](https://user-images.githubusercontent.com/10259764/87398269-819d5b00-c56a-11ea-9180-5c6ec1071b95.png) | ![newdark](https://user-images.githubusercontent.com/10259764/87399227-ead19e00-c56b-11ea-996d-ad52bc2dcbf3.png) |
| HC White | ![oldwhite](https://user-images.githubusercontent.com/10259764/87398320-92e66780-c56a-11ea-9d52-e2f6e31ae487.png) | ![newwhite](https://user-images.githubusercontent.com/10259764/87398340-98dc4880-c56a-11ea-87e2-ed257ad89c4a.png) |
| HC Black | ![oldblack](https://user-images.githubusercontent.com/10259764/87398357-9f6ac000-c56a-11ea-848c-1ccef6a65442.png) | ![newblack](https://user-images.githubusercontent.com/10259764/87398370-a396dd80-c56a-11ea-9540-8aa9bb934791.png) |
@ghost
Copy link

ghost commented Jul 22, 2020

🎉Windows Terminal Preview v1.2.2022.0 has been released which incorporates this pull request.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-UserInterface Issues pertaining to the user interface of the Console or Terminal Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI is broken in system high contrast mode
5 participants