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

Can't detect Windows High-Contrast mode for non-inverted HC themes #13178

Closed
BrendanMcK opened this issue Jun 7, 2018 · 1 comment
Closed

Comments

@BrendanMcK
Copy link

Electron currently has an isInvertedColorScheme that can be used to detect a sub-set of Windows' High Contrast modes (added in PR 7518). This only returns true for HC themes that are light-on-dark. If a dark-on-light HC theme is selected - see image below - this returns false.

This helper uses Chromium's helper of the same name. That does check for Windows High Contrast Mode (ie whether the SPI_GETHIGHCONTRAST flag is set), but it then filters out color schemes that have foreground lighter than background.

This works fine for Chromium's purposes - they don't support HC mode fully, they just want to know when an inverse-style scheme is used so they can suggest an appropriate inverted Chrome theme; hence the name - isInvertedColorScheme, not isHighContrastColorScheme.

If an Electron-based app does want to fully support all flavors of Windows High Contrast mode, this method is insufficient.

Ideal solution here perhaps is to add an additional helper and event specifically for Windows HC mode, similar to the Chromium-based ones, but without the color-based filtering. Suggest isHighContrastModeEnabled and high-contrast-mode-changed.

Image below shows an example white-on-black HC theme. Windows ships with 4 built-in schemes, three of which are light-on-dark. Users can also create custom themes by modifying any of those built-in schemes.

image

@jkleinsc
Copy link
Contributor

Resolved via #15493

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants