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

Fix High Contrast mode in Command Palette #18132

Merged
merged 2 commits into from
Oct 31, 2024

Conversation

carlos-zamora
Copy link
Member

Turns out that having the styles for the KeyChordText and ParsedCommandLineText be empty for high contrast mode caused the issue. Since we're already using theme resources for the colors, we automatically adjust properly to whatever the high contrast theme is (Thanks XAML!).

Bonus points:

  • we didn't need the theme dictionaries anymore, so I just moved them to the ResourceDictionary directly
  • ParsedCommandLineTextBlockStyle isn't used. So I removed it altogether.

Validated command palette with multiple high contrast themes. See PR thread for demo.

Closes #17914

@microsoft-github-policy-service microsoft-github-policy-service bot added Issue-Bug It either shouldn't be doing this or needs an investigation. Area-Accessibility Issues related to accessibility Product-Terminal The new Windows Terminal. labels Oct 31, 2024
@carlos-zamora
Copy link
Member Author

Demo (High Contrast: Night Sky)

image
image

Demo (High Contrast: Desert)

image
image

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.

Nicely done! Can you validate this on W10 as well? Different resource names maybe...

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.

I do not like XAML
I do not like it, Sam I Am

@carlos-zamora
Copy link
Member Author

Nicely done! Can you validate this on W10 as well? Different resource names maybe...

Validated on 22H2 19045.5073

@carlos-zamora carlos-zamora merged commit e83434f into main Oct 31, 2024
20 checks passed
@carlos-zamora carlos-zamora deleted the dev/cazamor/a11y/high-contrast-cmd-pal branch October 31, 2024 19:08
DHowett pushed a commit that referenced this pull request Nov 15, 2024
Turns out that having the styles for the KeyChordText and ParsedCommandLineText be empty for high contrast mode caused the issue. Since we're already using theme resources for the colors, we automatically adjust properly to whatever the high contrast theme is (Thanks XAML!).

Bonus points:
- we didn't need the theme dictionaries anymore, so I just moved them to the ResourceDictionary directly
- ParsedCommandLineTextBlockStyle isn't used. So I removed it altogether.

Validated command palette with multiple high contrast themes. See PR thread for demo.

Closes #17914

(cherry picked from commit e83434f)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmszgUZ6Mk
Service-Version: 1.21
DHowett pushed a commit that referenced this pull request Nov 15, 2024
Turns out that having the styles for the KeyChordText and ParsedCommandLineText be empty for high contrast mode caused the issue. Since we're already using theme resources for the colors, we automatically adjust properly to whatever the high contrast theme is (Thanks XAML!).

Bonus points:
- we didn't need the theme dictionaries anymore, so I just moved them to the ResourceDictionary directly
- ParsedCommandLineTextBlockStyle isn't used. So I removed it altogether.

Validated command palette with multiple high contrast themes. See PR thread for demo.

Closes #17914

(cherry picked from commit e83434f)
Service-Card-Id: PVTI_lADOAF3p4s4AmhmQzgUZ6Mo
Service-Version: 1.22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Accessibility Issues related to accessibility Issue-Bug It either shouldn't be doing this or needs an investigation. Product-Terminal The new Windows Terminal.
Projects
Status: Cherry Picked
Status: Cherry Picked
3 participants