From 58d17a51f3b8b045935acaf978c73e2d7f748049 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 7 Oct 2021 16:26:29 +1000 Subject: [PATCH] fix incorrect web background color being picked up in qt6+win/lin --- qt/aqt/theme.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/qt/aqt/theme.py b/qt/aqt/theme.py index f95799d50..5d43cb9b2 100644 --- a/qt/aqt/theme.py +++ b/qt/aqt/theme.py @@ -9,7 +9,16 @@ from dataclasses import dataclass from anki.utils import isMac from aqt import QApplication, colors, gui_hooks, isWin from aqt.platform import set_dark_mode -from aqt.qt import QColor, QIcon, QPainter, QPalette, QPixmap, QStyleFactory, Qt +from aqt.qt import ( + QColor, + QGuiApplication, + QIcon, + QPainter, + QPalette, + QPixmap, + QStyleFactory, + Qt, +) @dataclass @@ -135,7 +144,7 @@ class ThemeManager: return QColor(self.color(colors)) def apply_style(self, app: QApplication) -> None: - self.default_palette = app.style().standardPalette() + self.default_palette = QGuiApplication.palette() self._apply_palette(app) self._apply_style(app)