From fa1d6eae8480e3fd600c99e3a88eb8cd707729d9 Mon Sep 17 00:00:00 2001 From: llama <100429699+iamllama@users.noreply.github.com> Date: Thu, 17 Apr 2025 20:18:55 +0800 Subject: [PATCH] Fix flashing when opening the stats, empty cards or find dupes dialogs (#3928) * add AnkiWebView subclasses for stats, empty cards and find dupes ui * update ui files to use subclassed webviews instead * remove superfluous calls to AnkiWebView.set_kind * revert impl * set page background colour after setPage in AnkiWebView.set_kind (cherry picked from commit a74fd74631396e2513e7641f47227577ba0f552b) --- qt/aqt/webview.py | 1 + 1 file changed, 1 insertion(+) diff --git a/qt/aqt/webview.py b/qt/aqt/webview.py index c83eec41f..70bc5a25c 100644 --- a/qt/aqt/webview.py +++ b/qt/aqt/webview.py @@ -399,6 +399,7 @@ class AnkiWebView(QWebEngineView): # signal from the first one is received if kind != AnkiWebViewKind.DEFAULT: self.setPage(AnkiWebPage(self._onBridgeCmd, kind, self)) + self.page().setBackgroundColor(theme_manager.qcolor(colors.CANVAS)) def page(self) -> AnkiWebPage: return cast(AnkiWebPage, super().page())