mirror of
https://github.com/ankitects/anki.git
synced 2025-12-11 13:56:55 -05:00
make scrolling to answer customizable
This commit is contained in:
parent
e0f9d09abd
commit
0207298bb5
4 changed files with 18 additions and 2 deletions
|
|
@ -66,6 +66,7 @@ class Config(dict):
|
||||||
'showSuspendedCards': True,
|
'showSuspendedCards': True,
|
||||||
'simpleToolbar': True,
|
'simpleToolbar': True,
|
||||||
'editCurrentOnly': True,
|
'editCurrentOnly': True,
|
||||||
|
'scrollToAnswer': True,
|
||||||
}
|
}
|
||||||
for (k,v) in fields.items():
|
for (k,v) in fields.items():
|
||||||
if not self.has_key(k):
|
if not self.has_key(k):
|
||||||
|
|
|
||||||
|
|
@ -170,6 +170,7 @@ class Preferences(QDialog):
|
||||||
self.dialog.showTimer.setChecked(self.config['showTimer'])
|
self.dialog.showTimer.setChecked(self.config['showTimer'])
|
||||||
self.dialog.simpleToolbar.setChecked(self.config['simpleToolbar'])
|
self.dialog.simpleToolbar.setChecked(self.config['simpleToolbar'])
|
||||||
self.dialog.editCurrentOnly.setChecked(self.config['editCurrentOnly'])
|
self.dialog.editCurrentOnly.setChecked(self.config['editCurrentOnly'])
|
||||||
|
self.dialog.scrollToAnswer.setChecked(self.config['scrollToAnswer'])
|
||||||
self.dialog.toolbarIconSize.setText(str(self.config['iconSize']))
|
self.dialog.toolbarIconSize.setText(str(self.config['iconSize']))
|
||||||
|
|
||||||
def updateAdvanced(self):
|
def updateAdvanced(self):
|
||||||
|
|
@ -185,6 +186,7 @@ class Preferences(QDialog):
|
||||||
self.config['suppressEstimates'] = self.dialog.suppressEstimates.isChecked()
|
self.config['suppressEstimates'] = self.dialog.suppressEstimates.isChecked()
|
||||||
self.config['simpleToolbar'] = self.dialog.simpleToolbar.isChecked()
|
self.config['simpleToolbar'] = self.dialog.simpleToolbar.isChecked()
|
||||||
self.config['editCurrentOnly'] = self.dialog.editCurrentOnly.isChecked()
|
self.config['editCurrentOnly'] = self.dialog.editCurrentOnly.isChecked()
|
||||||
|
self.config['scrollToAnswer'] = self.dialog.scrollToAnswer.isChecked()
|
||||||
i = 32
|
i = 32
|
||||||
try:
|
try:
|
||||||
i = int(self.dialog.toolbarIconSize.text())
|
i = int(self.dialog.toolbarIconSize.text())
|
||||||
|
|
|
||||||
|
|
@ -125,8 +125,9 @@ class View(object):
|
||||||
|
|
||||||
def onLoadFinished(self):
|
def onLoadFinished(self):
|
||||||
if self.state == "showAnswer":
|
if self.state == "showAnswer":
|
||||||
mf = self.body.page().mainFrame()
|
if self.main.config['scrollToAnswer']:
|
||||||
mf.evaluateJavaScript("location.hash = 'answer'")
|
mf = self.body.page().mainFrame()
|
||||||
|
mf.evaluateJavaScript("location.hash = 'answer'")
|
||||||
|
|
||||||
# Top section
|
# Top section
|
||||||
##########################################################################
|
##########################################################################
|
||||||
|
|
|
||||||
|
|
@ -441,6 +441,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="10" column="0" >
|
||||||
|
<widget class="QCheckBox" name="scrollToAnswer" >
|
||||||
|
<property name="text" >
|
||||||
|
<string>Scroll down to the answer when showing answer</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
|
|
@ -502,6 +509,10 @@
|
||||||
<tabstops>
|
<tabstops>
|
||||||
<tabstop>tabWidget</tabstop>
|
<tabstop>tabWidget</tabstop>
|
||||||
<tabstop>interfaceLang</tabstop>
|
<tabstop>interfaceLang</tabstop>
|
||||||
|
<tabstop>interfaceFamily</tabstop>
|
||||||
|
<tabstop>interfaceSize</tabstop>
|
||||||
|
<tabstop>interfaceColour</tabstop>
|
||||||
|
<tabstop>backgroundColour</tabstop>
|
||||||
<tabstop>saveWhenClosing</tabstop>
|
<tabstop>saveWhenClosing</tabstop>
|
||||||
<tabstop>saveAfterEvery</tabstop>
|
<tabstop>saveAfterEvery</tabstop>
|
||||||
<tabstop>saveAfterEveryNum</tabstop>
|
<tabstop>saveAfterEveryNum</tabstop>
|
||||||
|
|
@ -520,6 +531,7 @@
|
||||||
<tabstop>tallButtons</tabstop>
|
<tabstop>tallButtons</tabstop>
|
||||||
<tabstop>showTray</tabstop>
|
<tabstop>showTray</tabstop>
|
||||||
<tabstop>editCurrentOnly</tabstop>
|
<tabstop>editCurrentOnly</tabstop>
|
||||||
|
<tabstop>scrollToAnswer</tabstop>
|
||||||
<tabstop>toolbarIconSize</tabstop>
|
<tabstop>toolbarIconSize</tabstop>
|
||||||
<tabstop>buttonBox</tabstop>
|
<tabstop>buttonBox</tabstop>
|
||||||
</tabstops>
|
</tabstops>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue