Skip to content

Fix hover, pressed, and highlight states in high contrast#149

Merged
danielchalmers merged 1 commit into
masterfrom
fix/high-contrast-highlight-states
Jul 11, 2026
Merged

Fix hover, pressed, and highlight states in high contrast#149
danielchalmers merged 1 commit into
masterfrom
fix/high-contrast-highlight-states

Conversation

@danielchalmers

@danielchalmers danielchalmers commented Jul 11, 2026

Copy link
Copy Markdown
Owner

The high-contrast palette (new in v5.5.0) maps HoverBrush and PressedBrush to 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:

  • Arrow-keying or hovering through the clock's right-click menu and the tray menu — the app's primary interaction surface, since the clock window is chromeless — gives no indication of which item is selected.
  • ComboBox dropdown navigation (Display / Typography / Appearance), button hover/press, and the checkbox hover all produce zero visual change.

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

  • High contrast — before: highlighted menu item, selected dropdown item, and hovered button all have no visible fill (screenshot hc-highlight-before.png).
  • High contrast — after: each shows the system Highlight fill with legible HighlightText (hc-highlight-after.png).
  • Light / dark: unchanged subtle-gray highlight with primary-colored text (hc-light-unchanged.png, hc-dark-unchanged.png).
  • Resolved values confirmed: HC HoverBrushSystemColors.Highlight (≠ window surface), OnHoverTextBrushSystemColors.HighlightText; light/dark OnHoverTextBrush equals primary text.

Before/after

image image

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.
@github-actions github-actions Bot added the bug Something isn't working label Jul 11, 2026
@danielchalmers danielchalmers changed the title Make hover, pressed, and highlight states visible in high contrast Fix hover, pressed, and highlight states in high contrast Jul 11, 2026
@danielchalmers
danielchalmers merged commit 801e6e8 into master Jul 11, 2026
5 checks passed
@danielchalmers
danielchalmers deleted the fix/high-contrast-highlight-states branch July 11, 2026 12:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant