Fix hover, pressed, and highlight states in high contrast#149
Merged
Conversation
In every built-in Windows high-contrast theme the Control color equals the window surface, so mapping HoverBrush and PressedBrush to Control left every hover, press, and menu/list highlight invisible - including keyboard navigation of the clock and tray context menus, the app's primary surface. Map those brushes to the system Highlight color, and add an OnHoverTextBrush so text and glyphs on the highlighted fill switch to HighlightText and stay legible. In light and dark the new brush equals the primary text color, so their subtle-tint hover states are unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The high-contrast palette (new in v5.5.0) maps
HoverBrushandPressedBrushto the system Control color. In every built-in Windows high-contrast theme, the Control (button-face) color is identical to the Window surface color, so those brushes paint a highlight that is the same color as the background behind it — i.e. invisible.The result for a high-contrast user:
This is exactly the mode where these cues matter most, and it's a regression from v5.4.0, whose stock WPF menus used the system Highlight color for the selected item.
Verification
hc-highlight-before.png).hc-highlight-after.png).hc-light-unchanged.png,hc-dark-unchanged.png).HoverBrush→SystemColors.Highlight(≠ window surface),OnHoverTextBrush→SystemColors.HighlightText; light/darkOnHoverTextBrushequals primary text.Before/after