diff --git a/aqt/webview.py b/aqt/webview.py index 0fee1f58b..0af406cfe 100644 --- a/aqt/webview.py +++ b/aqt/webview.py @@ -228,10 +228,15 @@ class AnkiWebView(QWebEngineView): css = [] if js is None: js = ["jquery.js"] + + palette = self.style().standardPalette() + color_hl = palette.color(QPalette.Highlight).name() + if isWin: #T: include a font for your language on Windows, eg: "Segoe UI", "MS Mincho" family = _('"Segoe UI"') widgetspec = "button { font-size: 12px; font-family:%s; }" % family + widgetspec += "\n:focus { outline: 1px solid %s; }" % color_hl fontspec = 'font-size:12px;font-family:%s;' % family elif isMac: family="Helvetica" @@ -241,9 +246,7 @@ class AnkiWebView(QWebEngineView): button { font-size: 13px; -webkit-appearance: none; background: #fff; border: 1px solid #ccc; border-radius:5px; font-family: Helvetica }""" else: - palette = self.style().standardPalette() family = self.font().family() - color_hl = palette.color(QPalette.Highlight).name() color_hl_txt = palette.color(QPalette.HighlightedText).name() color_btn = palette.color(QPalette.Button).name() fontspec = 'font-size:14px;font-family:"%s";'% family