Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Dark color scheme on Windows best practises
Forum Updated to NodeBB v4.3 + New Features

Dark color scheme on Windows best practises

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 4 Posters 596 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • l3u_L Offline
    l3u_L Offline
    l3u_
    wrote on last edited by
    #1

    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!

    1 Reply Last reply
    0
    • I Offline
      I Offline
      IgKh
      wrote on last edited by
      #2

      Qt ships with 3 windows styles:

      • windows - Emulates the Windows 9x style
      • windowsvista - Uses the UxTheme API to draw controls
      • windows11 - Uses WinUI to draw controls; this one is available only starting Qt 6.7

      Only windows and windows11 support a dark color scheme. The windowsvista style does not - it DOES correctly identify the system color theme and responds to changes, but still draws everything in light colors regardless.

      windowsvista is used by default on Windows 10, and windows11 is 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. windowsvista is 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.

      1 Reply Last reply
      2
      • l3u_L Offline
        l3u_L Offline
        l3u_
        wrote on last edited by
        #3

        Thanks for the info about the windows11 style! 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.

        S 1 Reply Last reply
        0
        • l3u_L l3u_

          Thanks for the info about the windows11 style! 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.

          S Offline
          S Offline
          SimonSchroeder
          wrote on last edited by
          #4

          @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.

          M 1 Reply Last reply
          0
          • S SimonSchroeder

            @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.

            M Offline
            M Offline
            mmortal03
            wrote last edited by
            #5

            @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.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved