mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
fix white flash on webview load
This commit is contained in:
parent
7dcbc7efec
commit
982aca0c99
1 changed files with 3 additions and 2 deletions
|
@ -247,6 +247,8 @@ class AnkiWebView(QWebEngineView): # type: ignore
|
||||||
return 3
|
return 3
|
||||||
|
|
||||||
def _getWindowColor(self):
|
def _getWindowColor(self):
|
||||||
|
if theme_manager.night_mode:
|
||||||
|
return theme_manager.qcolor("window-bg")
|
||||||
if isMac:
|
if isMac:
|
||||||
# standard palette does not return correct window color on macOS
|
# standard palette does not return correct window color on macOS
|
||||||
return QColor("#ececec")
|
return QColor("#ececec")
|
||||||
|
@ -317,7 +319,7 @@ div[contenteditable="true"]:focus {
|
||||||
<title>{}</title>
|
<title>{}</title>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
body {{ zoom: {}; background: {}; {} }}
|
body {{ zoom: {}; {} }}
|
||||||
{}
|
{}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
@ -328,7 +330,6 @@ body {{ zoom: {}; background: {}; {} }}
|
||||||
</html>""".format(
|
</html>""".format(
|
||||||
self.title,
|
self.title,
|
||||||
self.zoomFactor(),
|
self.zoomFactor(),
|
||||||
self._getWindowColor().name(),
|
|
||||||
fontspec,
|
fontspec,
|
||||||
widgetspec,
|
widgetspec,
|
||||||
head,
|
head,
|
||||||
|
|
Loading…
Reference in a new issue