mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 07:22:23 -04:00
allow browser override font to be unset
This commit is contained in:
parent
7405c1e7f1
commit
b81a64272e
2 changed files with 9 additions and 3 deletions
|
@ -358,6 +358,8 @@ adjust the template manually to switch the question and answer."""))
|
|||
t = self.card.template()
|
||||
f.qfmt.setText(t.get('bqfmt', ""))
|
||||
f.afmt.setText(t.get('bafmt', ""))
|
||||
if t.get("bfont"):
|
||||
f.overrideFont.setChecked(True)
|
||||
f.font.setCurrentFont(QFont(t.get('bfont', "Arial")))
|
||||
f.fontSize.setValue(t.get('bsize', 12))
|
||||
f.buttonBox.accepted.connect(lambda: self.onBrowserDisplayOk(f))
|
||||
|
@ -367,8 +369,12 @@ adjust the template manually to switch the question and answer."""))
|
|||
t = self.card.template()
|
||||
t['bqfmt'] = f.qfmt.text().strip()
|
||||
t['bafmt'] = f.afmt.text().strip()
|
||||
if f.overrideFont.isChecked():
|
||||
t['bfont'] = f.font.currentFont().family()
|
||||
t['bsize'] = f.fontSize.value()
|
||||
else:
|
||||
del t['bfont']
|
||||
del t['bsize']
|
||||
|
||||
def onTargetDeck(self):
|
||||
from aqt.tagedit import TagEdit
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<widget class="QLineEdit" name="afmt"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<widget class="QCheckBox" name="overrideFont">
|
||||
<property name="text">
|
||||
<string>Override font:</string>
|
||||
</property>
|
||||
|
|
Loading…
Reference in a new issue