Page MenuHome GnuPG

Kleopatra: Many icons are hard to see if the dark high-contrast mode is activated
Closed, ResolvedPublic

Description

See finding [5] in the Prüfbericht Barrierefreiheit GnuPG Kleopatra 3.1.20.3

Event Timeline

ikloecker created this task.

The standard Breeze icons (used by Kleopatra) are very dark because they are supposed to be used with a light color scheme. This can be "fixed" by the user by switching from the Breeze icon set to the Breeze Dark icon set.

But for this we would have to include the Breeze Dark icon theme in the installers and we should probably add a setting for switching between light and dark mode (at least on Windows; on Linux the users will anyway set their preferred theme for the whole desktop).

@aheinecke What do you think?

aheinecke moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.

I have had some problems detecting dark mode on Windows. Qt has a command line switch darkmode=1 or darkmode=2 for the windows platform theme. Which does not help. It also checks in QWindowsTheme for dark mode in the following code:

bool QWindowsTheme::queryDarkMode()
{
    if (QOperatingSystemVersion::current()
        < QOperatingSystemVersion(QOperatingSystemVersion::Windows, 10, 0, 17763)
        || queryHighContrast()) {
        return false;
    }
    const auto setting = QWinRegistryKey(HKEY_CURRENT_USER, LR"(Software\Microsoft\Windows\CurrentVersion\Themes\Personalize)")
                         .dwordValue(L"AppsUseLightTheme");
    return setting.second && setting.first == 0;
}

But this is then not used throughout. So if I switch the Theme to a dark mode, the Registry Key changes accordingly but the Qt Window still is bright, even after restart. So I have commented this part of the dark Mode detection out.

DarkMode is only handled correctly for the four Windows 10 high contrast Themes. But I think these are the most important.

aheinecke moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Sep 5 2022, 4:49 PM
aheinecke lowered the priority of this task from Normal to Wishlist.Feb 28 2023, 11:22 AM
aheinecke moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.

A finding has been that the icon theme switch is not detected at runtime. It would be nice if we could add this, especially if customers explicitly test the support for high contrast modes.

A quick research has shown that this would require us to add a nativeevent filter for WM_COLORCHANGE.

ikloecker changed the task status from Open to Testing.EditedJun 26 2024, 4:46 PM
ikloecker added a project: vsd33.

For the white high-contrast mode we use the normal (black) Breeze icons now. I think for Qt 5 that's all we can do with reasonable effort. For Qt 6/KF6 we have to revisit this anyway because a lot has changed (see T6932).

ikloecker moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Jul 2 2024, 2:53 PM
ikloecker moved this task from Backlog to WiP on the vsd33 board.

This also works for VSD 3.3 (because the required changes/patches are in gpg4win).

Well for 3.3 we will have full support for high contrast with the correct icons on all platforms, additionally we detect and support dark mode on all Windows 10 Versions > 1709 So this can be resolved. (Both for Qt5 and 6). What I have not yet checked if Qt6::systemInfo::colorScheme reports the correct one under windows 11 desert theme, but as you mention that is also part of a different issue where when then also should clean up the kleo systeminfo etc. if this is reliably supplied as information by qt.

ebo edited projects, added vsd33 (vsd-3.3.0); removed vsd33.
ebo moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Oct 1 2024, 3:55 PM
ebo moved this task from Restricted Project Column to Restricted Project Column on the Restricted Project board.Thu, Nov 14, 11:14 AM