specify font size again on osx

we lose the native button appearance, but the text is too small to
read on OSX otherwise
This commit is contained in:
Damien Elmes 2016-07-12 16:28:14 +10:00
parent 85215018a5
commit 74de1face7

View file

@ -140,19 +140,26 @@ class AnkiWebView(QWebEngineView):
return max(1, dpi / 96.0) return max(1, dpi / 96.0)
def stdHtml(self, body, css="", bodyClass="", js=None, head=""): def stdHtml(self, body, css="", bodyClass="", js=None, head=""):
buttonspec = ""
if isWin: if isWin:
fontspec = 'font-size:12px;font-family:"Segoe UI";font-weight: medium;' fontspec = 'font-size:12px;font-family:"Segoe UI";'
elif isMac: elif isMac:
fontspec = "" family=".AppleSystemUIFont"
fontspec = 'font-size:16px;font-family:"%s";'% \
family
buttonspec = """
button { font-size: 14px; -webkit-appearance: none; background: #fff; border: 1px solid #ccc;
border-radius:5px;}"""
else: else:
family = self.font().family() family = self.font().family()
fontspec = 'font-size:14px;font-family:%s;font-weight:medium;'%\ fontspec = 'font-size:14px;font-family:%s;'%\
family family
self.setHtml(""" self.setHtml("""
<!doctype html> <!doctype html>
<html><head><title>%s</title><style> <html><head><title>%s</title><style>
body { zoom: %f; %s } body { zoom: %f; %s }
%s
%s</style> %s</style>
<script> <script>
%s %s
@ -164,6 +171,7 @@ body { zoom: %f; %s }
self.title, self.title,
self.zoomFactor(), self.zoomFactor(),
fontspec, fontspec,
buttonspec,
css, js or anki.js.jquery+anki.js.browserSel, css, js or anki.js.jquery+anki.js.browserSel,
head, bodyClass, body)) head, bodyClass, body))