mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32: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()
|
t = self.card.template()
|
||||||
f.qfmt.setText(t.get('bqfmt', ""))
|
f.qfmt.setText(t.get('bqfmt', ""))
|
||||||
f.afmt.setText(t.get('bafmt', ""))
|
f.afmt.setText(t.get('bafmt', ""))
|
||||||
|
if t.get("bfont"):
|
||||||
|
f.overrideFont.setChecked(True)
|
||||||
f.font.setCurrentFont(QFont(t.get('bfont', "Arial")))
|
f.font.setCurrentFont(QFont(t.get('bfont', "Arial")))
|
||||||
f.fontSize.setValue(t.get('bsize', 12))
|
f.fontSize.setValue(t.get('bsize', 12))
|
||||||
f.buttonBox.accepted.connect(lambda: self.onBrowserDisplayOk(f))
|
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 = self.card.template()
|
||||||
t['bqfmt'] = f.qfmt.text().strip()
|
t['bqfmt'] = f.qfmt.text().strip()
|
||||||
t['bafmt'] = f.afmt.text().strip()
|
t['bafmt'] = f.afmt.text().strip()
|
||||||
t['bfont'] = f.font.currentFont().family()
|
if f.overrideFont.isChecked():
|
||||||
t['bsize'] = f.fontSize.value()
|
t['bfont'] = f.font.currentFont().family()
|
||||||
|
t['bsize'] = f.fontSize.value()
|
||||||
|
else:
|
||||||
|
del t['bfont']
|
||||||
|
del t['bsize']
|
||||||
|
|
||||||
def onTargetDeck(self):
|
def onTargetDeck(self):
|
||||||
from aqt.tagedit import TagEdit
|
from aqt.tagedit import TagEdit
|
||||||
|
|
|
@ -35,7 +35,7 @@
|
||||||
<widget class="QLineEdit" name="afmt"/>
|
<widget class="QLineEdit" name="afmt"/>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QCheckBox" name="overrideFont">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Override font:</string>
|
<string>Override font:</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
Loading…
Reference in a new issue