diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2023-10-10 13:39:06 +0800 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2023-10-13 20:12:27 +0800 |
commit | b90b624ce0e87a8c96ce12276aa60377a8de24ff (patch) | |
tree | 3fb489129a5eb7519981fcb21b9d68c99b05755a /src/plugins/platforms/windows/qwindowstheme.cpp | |
parent | 11424b3f518eea68110b7167643009bb35982418 (diff) |
QWindowsTheme: only set inactive accent color to Window if not set
Otherwise it incorrectly changes to a white-ish color when the window
becomes inactive, when native apps keep the accent color.
Fixes: QTBUG-116826
Change-Id: I3837e7ca93a494e60dbe5f1b7f8607b3dd16d29e
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowstheme.cpp')
-rw-r--r-- | src/plugins/platforms/windows/qwindowstheme.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/plugins/platforms/windows/qwindowstheme.cpp b/src/plugins/platforms/windows/qwindowstheme.cpp index 4fccec98fb..636479b1e3 100644 --- a/src/plugins/platforms/windows/qwindowstheme.cpp +++ b/src/plugins/platforms/windows/qwindowstheme.cpp @@ -591,8 +591,12 @@ QPalette QWindowsTheme::systemPalette(Qt::ColorScheme colorScheme) result.color(QPalette::Inactive, QPalette::Window)); result.setColor(QPalette::Inactive, QPalette::HighlightedText, result.color(QPalette::Inactive, QPalette::Text)); - result.setColor(QPalette::Inactive, QPalette::Accent, - result.color(QPalette::Inactive, QPalette::Window)); + // Only set this if it hasn't been set. + if (!result.isBrushSet(QPalette::Inactive, QPalette::Accent)) { + // We set Accent to Window to match the behavior of Windows 11. + result.setColor(QPalette::Inactive, QPalette::Accent, + result.color(QPalette::Inactive, QPalette::Window)); + } } const QColor disabled = mixColors(result.windowText().color(), result.button().color()); |