Edit book: Fix changing the color scheme not changing background color in Qt 6.5

This commit is contained in:
Kovid Goyal 2023-11-13 13:38:07 +05:30
parent 9741a12e02
commit 416237a2a5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -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'))