qBittorrent icon indicating copy to clipboard operation
qBittorrent copied to clipboard

Dark Mode: Windows - Qt 6's use of "accent" color for the `QPalette::Highlight` color role creates a negative "user experience"

Open xavier2k6 opened this issue 1 year ago • 0 comments

qBittorrent & operating system versions

qBittorrent: 5.0.0 x64 Operating system: Windows 10 Pro x64 (22H2) 10.0.19045 Qt: 6.7.3 libtorrent-rasterbar: 2.0.11

What is the problem?

Qt 6 uses accent color on Windows when reading the dark system palette, this causes a negative/undesired/unexpected "user experience".

See other examples:

  • #21503
  • #21427

Steps to reproduce

  1. Enable Dark Mode.
  2. Change accent color in Windows
  3. Observe alternating row colors/progress bar.....highlight text in Execution Logs & some icons are barely visible etc due to change to match the accent color

Additional context

When we read the dark system palette on Windows, then we use the theme's accent color for the QPalette::Highlight color role. This is however not quite correct, as the Accent is used in other places as well, and some controls use different colors (i.e. on Windows 11's "red" dark theme, the highlight is bright red, while the focus frames are in a paler orange). QPalette doesn't have an Accent color role right now, and adding that is a bit complex as the internal QPalette data structures need to change quite a bit once we go above 21 color roles - and we are at 21 already.

https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5#:~:text=When%20we%20read%20the%20dark%20system%20palette%20on%20Windows,%20then%20we%20use%20the%20theme's%20accent%20color%20for%20the%20QPalette::Highlight%20color%20role.

Log(s) & preferences file(s)

N/A

xavier2k6 avatar Oct 15 '24 15:10 xavier2k6