From 416237a2a560d8b03bfabae670c8e56875d64330 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 13 Nov 2023 13:38:07 +0530 Subject: [PATCH] Edit book: Fix changing the color scheme not changing background color in Qt 6.5 --- src/calibre/gui2/tweak_book/editor/text.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/calibre/gui2/tweak_book/editor/text.py b/src/calibre/gui2/tweak_book/editor/text.py index 650520e2a9..ae33506339 100644 --- a/src/calibre/gui2/tweak_book/editor/text.py +++ b/src/calibre/gui2/tweak_book/editor/text.py @@ -240,6 +240,9 @@ class TextEdit(PlainTextEdit): pal.setColor(QPalette.ColorRole.Highlight, theme_color(theme, 'Visual', 'bg')) pal.setColor(QPalette.ColorRole.HighlightedText, theme_color(theme, 'Visual', 'fg')) self.setPalette(pal) + vpal = self.viewport().palette() + vpal.setColor(QPalette.ColorRole.Base, pal.color(QPalette.ColorRole.Base)) + self.viewport().setPalette(vpal) self.tooltip_palette = pal = QPalette() pal.setColor(QPalette.ColorRole.ToolTipBase, theme_color(theme, 'Tooltip', 'bg')) pal.setColor(QPalette.ColorRole.ToolTipText, theme_color(theme, 'Tooltip', 'fg'))