Skip to content

Commit

Permalink
Revert "No longer need highlighted colors in inactive windows workaro…
Browse files Browse the repository at this point in the history
…und as of Qt 6.5"

This reverts commit 5e911aa.
  • Loading branch information
kovidgoyal committed Dec 16, 2023
1 parent 944fcb0 commit dd32a88
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/calibre/gui2/palette.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,14 @@ def serialize_palette_as_python(self):


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


Expand Down

0 comments on commit dd32a88

Please sign in to comment.