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
This commit is contained in:
llama 2025-04-17 20:18:55 +08:00 committed by GitHub
parent 1a68c9f5d5
commit a74fd74631
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -399,6 +399,7 @@ class AnkiWebView(QWebEngineView):
# signal from the first one is received # signal from the first one is received
if kind != AnkiWebViewKind.DEFAULT: if kind != AnkiWebViewKind.DEFAULT:
self.setPage(AnkiWebPage(self._onBridgeCmd, kind, self)) self.setPage(AnkiWebPage(self._onBridgeCmd, kind, self))
self.page().setBackgroundColor(theme_manager.qcolor(colors.CANVAS))
def page(self) -> AnkiWebPage: def page(self) -> AnkiWebPage:
return cast(AnkiWebPage, super().page()) return cast(AnkiWebPage, super().page())