diff --git a/aqt/browser.py b/aqt/browser.py index 88bb81f0f..510eb2932 100644 --- a/aqt/browser.py +++ b/aqt/browser.py @@ -10,7 +10,7 @@ import anki, anki.utils, aqt.forms from anki.utils import fmtTimeSpan, ids2str, stripHTMLMedia, isWin, intTime from aqt.utils import saveGeom, restoreGeom, saveSplitter, restoreSplitter, \ saveHeader, restoreHeader, saveState, restoreState, applyStyles, getTag, \ - showInfo, askUser, tooltip, openHelp + showInfo, askUser, tooltip, openHelp, fontForPlatform from anki.errors import * from anki.db import * from anki.hooks import runHook, addHook, remHook @@ -599,6 +599,9 @@ class Browser(QMainWindow): p = QPalette() p.setColor(QPalette.Base, QColor("#d6dde0")) self.form.tree.setPalette(p) + f = QFont() + f.setFamily(fontForPlatform()) + self.form.tree.setFont(f) self.buildTree() def buildTree(self): diff --git a/aqt/overview.py b/aqt/overview.py index 4dc3e0210..c2d469feb 100644 --- a/aqt/overview.py +++ b/aqt/overview.py @@ -122,7 +122,7 @@ h3 { margin-bottom: 0; } td { font-size: 14px; } button { font-weight: bold; } .descfont { -font: 12px/18px "Lucida Grande","Lucida Sans Unicode",Arial,Verdana,sans-serif; +font-size: 12px; padding: 1em; color: #333; } .description { diff --git a/aqt/profiles.py b/aqt/profiles.py index aad19c6ae..2086bcaec 100644 --- a/aqt/profiles.py +++ b/aqt/profiles.py @@ -11,7 +11,7 @@ import os, sys, time, random, cPickle, shutil, locale, re, atexit from anki.db import DB from anki.utils import isMac, isWin, intTime, checksum from anki.lang import langs, _ -from aqt.utils import showWarning +from aqt.utils import showWarning, fontForPlatform import aqt.forms metaConf = dict( @@ -40,7 +40,7 @@ profileConf = dict( searchHistory=[], recentColours=["#000000", "#0000ff"], stripHTML=True, - editFontFamily='Arial', + editFontFamily=fontForPlatform(), editFontSize=12, editLineSize=20, deleteMedia=False, diff --git a/aqt/toolbar.py b/aqt/toolbar.py index 9aa8c0e7b..64f4a3064 100644 --- a/aqt/toolbar.py +++ b/aqt/toolbar.py @@ -119,10 +119,6 @@ color: #000; .hitem:hover { text-decoration: underline; } - -button { -font-weight: bold; -} """ class BottomBar(Toolbar): diff --git a/aqt/utils.py b/aqt/utils.py index 4f2614196..a7f2bc1aa 100644 --- a/aqt/utils.py +++ b/aqt/utils.py @@ -345,6 +345,11 @@ def maybeHideClose(bbox): if b: bbox.removeButton(b) +def fontForPlatform(): + if isMac: + return "Lucida Grande" + return "Arial" + # Tooltips ###################################################################### diff --git a/aqt/webview.py b/aqt/webview.py index bb8cfcbd3..8408e50e6 100644 --- a/aqt/webview.py +++ b/aqt/webview.py @@ -4,6 +4,8 @@ import sys from aqt.qt import * +from aqt.utils import fontForPlatform +from anki.utils import isMac import anki.js QtConfig = pyqtconfig.Configuration() @@ -80,13 +82,23 @@ class AnkiWebView(QWebView): self._loadFinishedCB = loadCB QWebView.setHtml(self, html) def stdHtml(self, body, css="", bodyClass="", loadCB=None, head=""): + if isMac: + button = "font-weight: bold; height: 24px;" + else: + button = "" self.setHtml(""" -
+ %s + %s""" % ( - css, anki.js.all, head, bodyClass, body), loadCB) + fontForPlatform(), button, css, anki.js.all, head, bodyClass, body), loadCB) def setBridge(self, bridge): self._bridge.setBridge(bridge) def eval(self, js): diff --git a/designer/browser.ui b/designer/browser.ui index c1820ae04..85c82ef41 100644 --- a/designer/browser.ui +++ b/designer/browser.ui @@ -43,12 +43,6 @@