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

Support Windows High Contrast mode #577

Open
llemeurfr opened this issue Aug 13, 2019 · 19 comments
Open

Support Windows High Contrast mode #577

llemeurfr opened this issue Aug 13, 2019 · 19 comments

Comments

@llemeurfr
Copy link
Contributor

The High Contrast Mode is a system mode, where users can choose background and foreground color, buttons and links, selected text.

Support on this mode has to go through an evolution of Readium CSS.
Seems related to readium/readium-css#6 (themes) and somewhat related to readium/readium-css#65 (issue about highlight).

@JayPanoz
Copy link

JayPanoz commented Aug 13, 2019

Related ReadiumCSS module: ReadiumCSS-os_a11y.css (it’s more of a placeholder/WIP currently, because media queries are moving at a very quick pace)

Question though: does Electron have any ability to detect high-contrast-mode in Windows? (in order to pass a flag to ReadiumCSS)

Because currently, there’s -ms-high-contrast but it only works in Microsoft’s IE/Edge:

And the contrast/forced colors/transparency queries are currently being standardised in Level 5

@JayPanoz
Copy link

Note you have to use an extension in Chrome for high-contrast: chromium low-vision page

@JayPanoz
Copy link

And related Electron issue: electron/electron#13178

@danielweck
Copy link
Member

Related issue: #83

@danielweck
Copy link
Member

See note about SVG icons:
#410 (comment)

@Scarsniik
Copy link
Contributor

Scarsniik commented Oct 10, 2019

In the version of electron we are using, there isn't the event I need to use to detect that the high contrast mode is enable. When do you think you will migrate to electron 6 @danielweck ?

@danielweck
Copy link
Member

ASAP. I don't want to leave this for later. Let's tackle the migration early on, so we can run lots of tests.

@danielweck
Copy link
Member

@danielweck
Copy link
Member

@danielweck
Copy link
Member

Then when the NPM packages are published, we can migrate readium-desktop (but for LCP I will have to recompile the native libs for Windows, Linux, MacOS, 32/64 bits...)

@Scarsniik
Copy link
Contributor

Ok, cool
Then I'll do it without the event and put it in WIP until we use the good version

@danielweck
Copy link
Member

Also note that Electron6 has a known bug with Windows dark mode in developer mode (developer tools not compatible), so as developers, we must switch to light mode when using the dev tools.

@panaC
Copy link
Member

panaC commented Oct 19, 2020

@panaC
Copy link
Member

panaC commented Oct 19, 2020

what is the progress status of this issue ?

it's narrow linked with the css. It may rather be a dedicated task for the css master.

@danielweck
Copy link
Member

Merged issue: #1726

Description

Under Windows, if a high-contrast theme is used, some of the elements in the UI of Thorium Reader are not visible. Examples of such elements are the buttons in the top toolbar and the button with actions for a book. See attached screenshots for examples.

Steps to reproduce

  1. Enable high-contrast mode in Windows 11, by doing the following:
    1.1. Open Windows Settings (Windows+I).
    1.2. Go to Accessibility ➡ Contrast themes.
    1.3. From the "Contrast themes" combo-box, select any dark theme (e.g. "Night Sky").
    1.4. Activate the "Apply" button.
  2. Launch Thorium Reader.
  3. If you don't have any books added, add at least one.
  4. Observe how the button with the 3 vertical dots (the one that opens the menu for a book) is not visible.
  5. Open for reading one of the added books.
  6. Observe how the buttons in the toolbar on the top are not visible.

Test environment

  • Operating system: Windows 11 Pro version 21H2 (build 22000.795), 64-bit, in Bulgarian with all locale settings set to "Bulgarian".
  • Thorium Reader version: v2.0.0, installed from the Microsoft Store.

2022-07-25_09-21-50
2022-07-25_09-23-00

2022-07-25_09-24-19
2022-07-25_09-24-58
2022-07-25_09-24-45
2022-07-25_09-23-46

@danielweck
Copy link
Member

Besides pure-CSS techniques, let's not forget Electron's own system preferences API: https://www.electronjs.org/docs/latest/api/system-preferences#systempreferencesgetcolorcolor-windows-macos
(we can also listen to colour theme change events)

@danielweck
Copy link
Member

I don't think we will have time to implement this for Thorium 3.0 but definitely something to explore in 3.1 as a logical follow-up to the introduction of system dark/light modes and additional colour themes

@panaC panaC mentioned this issue May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants