Edit book: Live CSS: Fix regression causing incorrect colors in calibre 7.

Yet another Qt regression. Sigh. This time it looks like QPalette color
propagation is broken.
This commit is contained in:
Kovid Goyal 2024-02-27 11:31:20 +05:30
parent c5a9ce6bfc
commit 826e35cb19
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -193,6 +193,12 @@ class Declaration(QWidget):
p.setPen(palette.color(QPalette.ColorRole.WindowText)) p.setPen(palette.color(QPalette.ColorRole.WindowText))
if not self.is_first: if not self.is_first:
p.drawLine(0, 0, self.width(), 0) p.drawLine(0, 0, self.width(), 0)
parent = self
while parent is not None:
parent = parent.parent()
if isinstance(parent, LiveCSS):
palette = parent.palette()
break
try: try:
for row in self.rows: for row in self.rows:
for cell in row: for cell in row: