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 a74fd74631)
This commit is contained in:
llama 2025-04-17 20:18:55 +08:00 committed by Damien Elmes
parent 234fa0c2f4
commit fa1d6eae84

View file

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