Dark color scheme on Windows best practises
-
Hi all,
I develop a program I build on Linux, macOS and Windows. Even in Qt 5.15 times, I could support a dark color scheme on Linux and macOS. It worked fine, also run-time changes (I added a custom QApplication reacting to ApplicationPaletteChange events and telling the rest of the program to update icons etc. according to the new scheme).
With Qt 6, we seem to have at least partial support for a dark color scheme on Windows. Now there's e.g. https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5 talking about Qt::ColorScheme QStyleHints. IIRC, this was introduced with Qt 6.5, but 6.5 is a minimum to work on anyway, as older versions aren't even there to download anymore.
However, a Qt program started on Windows doesn't care about the chosen color scheme – unless started using the Fusion style. With Fusion, it reacts on color scheme changes, like on e.g. Linux.
I wonder what's the correct approach on Windows. I think the default Windows style is set for a reason, so maybe, I should not set Fusion by default, should I? Do I check the color scheme on startup and monitor changes, and set Fusion in case a dark scheme is set, and the default Windows style if not?
Thanks for all input!
-
Qt ships with 3 windows styles:
windows- Emulates the Windows 9x stylewindowsvista- Uses the UxTheme API to draw controlswindows11- Uses WinUI to draw controls; this one is available only starting Qt 6.7
Only
windowsandwindows11support a dark color scheme. Thewindowsvistastyle does not - it DOES correctly identify the system color theme and responds to changes, but still draws everything in light colors regardless.windowsvistais used by default on Windows 10, andwindows11is used by default on Windows 11 (but it does support Windows 10 starting Qt 6.8.1 - it is just not the default).I don't think there is a "correct" approach for Windows.
windowsvistais an easy default, but Windows was never big on visual consistency and every application looking its' own way is the case for years. If the Fusion style looks and feels good for your app, I don't think there is any downside for using it. I wouldn't try to dynamically switch between styles, that will just be confusing for users. -
Thanks for the info about the
windows11style! I think the best approach would actually be to leave Windows 10 as-is (no dark mode support). On Windows 11, with the new style being the default, dark mode simply works.I agree that switching styles run-time to get dark mode working on Windows 10 simply might confuse users.
-
Thanks for the info about the
windows11style! I think the best approach would actually be to leave Windows 10 as-is (no dark mode support). On Windows 11, with the new style being the default, dark mode simply works.I agree that switching styles run-time to get dark mode working on Windows 10 simply might confuse users.
@l3u_ said in Dark color scheme on Windows best practises:
I think the best approach would actually be to leave Windows 10 as-is
As of Oktober this year almost nobody should be using Windows 10 anymore (though many will). Official support is ending by then and you'll be vulnerable to attacks. A few people might opt-in to extended support for a couple more months.
-
@l3u_ said in Dark color scheme on Windows best practises:
I think the best approach would actually be to leave Windows 10 as-is
As of Oktober this year almost nobody should be using Windows 10 anymore (though many will). Official support is ending by then and you'll be vulnerable to attacks. A few people might opt-in to extended support for a couple more months.
@SimonSchroeder said in Dark color scheme on Windows best practises:
As of Oktober this year almost nobody should be using Windows 10 anymore (though many will). Official support is ending by then and you'll be vulnerable to attacks. A few people might opt-in to extended support for a couple more months.
I would say it's more than a few people who will be getting the Extended Security Updates for the next 11 months, and, after that, there still remain long term supported Enterprise versions of Windows 10, with support through January 2027 and 2032.
There are definitely going to be lots of people trying to find ways to not make unnecessary e-waste out of their otherwise still functioning hardware.