mirror of
https://github.com/ankitects/anki.git
synced 2025-09-25 01:06:35 -04:00
configurable q/a split
This commit is contained in:
parent
bb083ab965
commit
5f0d9bcfd5
4 changed files with 15 additions and 3 deletions
|
@ -67,6 +67,7 @@ class Config(dict):
|
||||||
'simpleToolbar': True,
|
'simpleToolbar': True,
|
||||||
'scrollToAnswer': True,
|
'scrollToAnswer': True,
|
||||||
'qaDivider': True,
|
'qaDivider': True,
|
||||||
|
'splitQA': True,
|
||||||
'sortIndex': 0,
|
'sortIndex': 0,
|
||||||
}
|
}
|
||||||
for (k,v) in fields.items():
|
for (k,v) in fields.items():
|
||||||
|
|
|
@ -171,6 +171,7 @@ class Preferences(QDialog):
|
||||||
self.dialog.simpleToolbar.setChecked(self.config['simpleToolbar'])
|
self.dialog.simpleToolbar.setChecked(self.config['simpleToolbar'])
|
||||||
self.dialog.scrollToAnswer.setChecked(self.config['scrollToAnswer'])
|
self.dialog.scrollToAnswer.setChecked(self.config['scrollToAnswer'])
|
||||||
self.dialog.showDivider.setChecked(self.config['qaDivider'])
|
self.dialog.showDivider.setChecked(self.config['qaDivider'])
|
||||||
|
self.dialog.splitQA.setChecked(self.config['splitQA'])
|
||||||
self.dialog.toolbarIconSize.setText(str(self.config['iconSize']))
|
self.dialog.toolbarIconSize.setText(str(self.config['iconSize']))
|
||||||
|
|
||||||
def updateAdvanced(self):
|
def updateAdvanced(self):
|
||||||
|
@ -187,6 +188,7 @@ class Preferences(QDialog):
|
||||||
self.config['simpleToolbar'] = self.dialog.simpleToolbar.isChecked()
|
self.config['simpleToolbar'] = self.dialog.simpleToolbar.isChecked()
|
||||||
self.config['scrollToAnswer'] = self.dialog.scrollToAnswer.isChecked()
|
self.config['scrollToAnswer'] = self.dialog.scrollToAnswer.isChecked()
|
||||||
self.config['qaDivider'] = self.dialog.showDivider.isChecked()
|
self.config['qaDivider'] = self.dialog.showDivider.isChecked()
|
||||||
|
self.config['splitQA'] = self.dialog.splitQA.isChecked()
|
||||||
i = 32
|
i = 32
|
||||||
try:
|
try:
|
||||||
i = int(self.dialog.toolbarIconSize.text())
|
i = int(self.dialog.toolbarIconSize.text())
|
||||||
|
|
|
@ -119,6 +119,8 @@ class View(object):
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
||||||
def center(self, str, height=45):
|
def center(self, str, height=45):
|
||||||
|
if not self.main.config['splitQA']:
|
||||||
|
return str
|
||||||
return '''
|
return '''
|
||||||
<div style="display: table; height: %s%%; width:100%%; overflow: hidden;">
|
<div style="display: table; height: %s%%; width:100%%; overflow: hidden;">
|
||||||
<div style="display: table-cell; vertical-align: middle;">
|
<div style="display: table-cell; vertical-align: middle;">
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>322</width>
|
<width>322</width>
|
||||||
<height>417</height>
|
<height>438</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle" >
|
<property name="windowTitle" >
|
||||||
|
@ -16,7 +16,7 @@
|
||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget" >
|
<widget class="QTabWidget" name="tabWidget" >
|
||||||
<property name="currentIndex" >
|
<property name="currentIndex" >
|
||||||
<number>0</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab_1" >
|
<widget class="QWidget" name="tab_1" >
|
||||||
<property name="geometry" >
|
<property name="geometry" >
|
||||||
|
@ -362,7 +362,7 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>306</width>
|
<width>306</width>
|
||||||
<height>351</height>
|
<height>372</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<attribute name="title" >
|
<attribute name="title" >
|
||||||
|
@ -448,6 +448,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="11" column="0" >
|
||||||
|
<widget class="QCheckBox" name="splitQA" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Put space between question and answer</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
Loading…
Reference in a new issue