From 111727240bdc8278a07f270845c62dc55ae4435f Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 10 Apr 2019 15:16:06 +1000 Subject: [PATCH] standard blue focus highlight on windows --- aqt/webview.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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