From a3bdd04d42cc48972a925f9faf532203c0d6f1ec Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 23 Jun 2017 13:07:59 +1000 Subject: [PATCH] set bgcol in ankiwebview --- aqt/main.py | 1 - aqt/reviewer.py | 2 -- aqt/toolbar.py | 6 ++---- aqt/webview.py | 5 +++-- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/aqt/main.py b/aqt/main.py index dd77f53a6..dfbf2367f 100644 --- a/aqt/main.py +++ b/aqt/main.py @@ -485,7 +485,6 @@ the manual for information on how to restore from an automatic backup.")) sharedCSS = """ body { -background: #f3f3f3; margin: 2em; } h1 { margin-bottom: 0.2em; } diff --git a/aqt/reviewer.py b/aqt/reviewer.py index f27f7b162..987f46d37 100644 --- a/aqt/reviewer.py +++ b/aqt/reviewer.py @@ -533,8 +533,6 @@ min-width: 60px; white-space: nowrap; .spacer2 { height: 16px; } #outer { border-top: 1px solid #aaa; - background: -webkit-gradient(linear, left top, left bottom, -from(#fff), to(#ddd)); } #innertable { padding: 3px; diff --git a/aqt/toolbar.py b/aqt/toolbar.py index ea2ea38b4..00f324c48 100644 --- a/aqt/toolbar.py +++ b/aqt/toolbar.py @@ -29,13 +29,12 @@ class Toolbar: def draw(self): self.web.onBridgeCmd = self._linkHandler self.web.onLoadFinished = self.onLoaded - bgcol = QApplication.instance().palette().window().color().name() self.web.stdHtml(self._body % ( # may want a context menu here in the future ' '*20, self._centerLinks(), self._rightIcons()), - self._css % bgcol) + self._css) # Available links ###################################################################### @@ -164,7 +163,6 @@ margin-top: 0; def draw(self, buf): self.web.onBridgeCmd = self._linkHandler self.web.onLoadFinished = self.onLoaded - bgcol = QApplication.instance().palette().window().color().name() self.web.stdHtml( self._centerBody % buf, - self._css % bgcol) + self._css) diff --git a/aqt/webview.py b/aqt/webview.py index 5a459dfcf..cf551e100 100644 --- a/aqt/webview.py +++ b/aqt/webview.py @@ -141,7 +141,7 @@ class AnkiWebView(QWebEngineView): dpi = screen.logicalDpiX() return max(1, dpi / 96.0) - def stdHtml(self, body, css="", bodyClass="", js=None, head=""): + def stdHtml(self, body, css="", bodyClass="", js=None, head="", bgcol=None): if isWin: buttonspec = "button { font-size: 12px; font-family:'Segoe UI'; }" fontspec = 'font-size:12px;font-family:"Segoe UI";' @@ -161,7 +161,7 @@ border-radius:5px; font-family: Helvetica }""" html=""" %s