Skip to content

Draft: Load binary icons based on windows theme

Andre Heinecke requested to merge work/aheinecke/win-dark-mode-detection into kf5

This adds detection code for high contrast / dark mode to KIconTheme so that it can detect early on which theme to load when binary icons are used and loaded from a file.

GnuPG-Bug-Id: T6076


This is a draft because it intends to replace !109 (closed) we are shipping this now as part of Gpg4win. We need dark mode detection in KIconThemes because we very early must decide which of our binary themes we load. I want to publish this here as an MR to increase transparency and because I have one problem remaining with the code: - It fails to correctly detect the white (or as it is now called "Desert") high contrast scheme.

While I have not done testing on Windows the code in: https://code.qt.io/cgit/qt/qtbase.git/tree/src/plugins/platforms/windows/qwindowstheme.cpp#n1189

Looks wrong to me because it checks for high contrast like we do and then returns false for dark mode, except I don't really think that people use the bright high contrast mode and the other three windows high contrast modes are all dark. And this is also not exposed as an API so this is something we might need to have at some place inside of KDE. If it should be here that is a different question.

Merge request reports