From 982aca0c99c02af5e2d4f932574c2a779edc2c6b Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Thu, 23 Jan 2020 15:27:30 +1000 Subject: [PATCH] fix white flash on webview load --- qt/aqt/webview.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qt/aqt/webview.py b/qt/aqt/webview.py index a095c9c41..4b324d14b 100644 --- a/qt/aqt/webview.py +++ b/qt/aqt/webview.py @@ -247,6 +247,8 @@ class AnkiWebView(QWebEngineView): # type: ignore return 3 def _getWindowColor(self): + if theme_manager.night_mode: + return theme_manager.qcolor("window-bg") if isMac: # standard palette does not return correct window color on macOS return QColor("#ececec") @@ -317,7 +319,7 @@ div[contenteditable="true"]:focus { {} @@ -328,7 +330,6 @@ body {{ zoom: {}; background: {}; {} }} """.format( self.title, self.zoomFactor(), - self._getWindowColor().name(), fontspec, widgetspec, head,