From dd32a881665bb62d94eb718ba5eebe44d27b36b8 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 16 Dec 2023 13:03:56 +0530 Subject: [PATCH] Revert "No longer need highlighted colors in inactive windows workaround as of Qt 6.5" This reverts commit 5e911aa98088896e510cd9b4f33c75e8f10a6ee1. --- src/calibre/gui2/palette.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/calibre/gui2/palette.py b/src/calibre/gui2/palette.py index 6e303fe58b..a0e477ff16 100644 --- a/src/calibre/gui2/palette.py +++ b/src/calibre/gui2/palette.py @@ -108,6 +108,14 @@ QPalette.unserialize_from_bytes = unserialize_palette def fix_palette_colors(p): + if iswindows: + # On Windows the highlighted colors for inactive widgets are the + # same as non highlighted colors. This is a regression from Qt 4. + # Possibly fixed in Qt 6.5 need to test + # https://bugreports.qt-project.org/browse/QTBUG-41060 + for role in (QPalette.ColorRole.Highlight, QPalette.ColorRole.HighlightedText, QPalette.ColorRole.Base, QPalette.ColorRole.AlternateBase): + p.setColor(QPalette.ColorGroup.Inactive, role, p.color(QPalette.ColorGroup.Active, role)) + return True return False