mirror of
https://github.com/ankitects/anki.git
synced 2025-12-10 13:26:56 -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,
|
||||
'simpleToolbar': True,
|
||||
'editCurrentOnly': True,
|
||||
'scrollToAnswer': True,
|
||||
}
|
||||
for (k,v) in fields.items():
|
||||
if not self.has_key(k):
|
||||
|
|
|
|||
|
|
@ -170,6 +170,7 @@ class Preferences(QDialog):
|
|||
self.dialog.showTimer.setChecked(self.config['showTimer'])
|
||||
self.dialog.simpleToolbar.setChecked(self.config['simpleToolbar'])
|
||||
self.dialog.editCurrentOnly.setChecked(self.config['editCurrentOnly'])
|
||||
self.dialog.scrollToAnswer.setChecked(self.config['scrollToAnswer'])
|
||||
self.dialog.toolbarIconSize.setText(str(self.config['iconSize']))
|
||||
|
||||
def updateAdvanced(self):
|
||||
|
|
@ -185,6 +186,7 @@ class Preferences(QDialog):
|
|||
self.config['suppressEstimates'] = self.dialog.suppressEstimates.isChecked()
|
||||
self.config['simpleToolbar'] = self.dialog.simpleToolbar.isChecked()
|
||||
self.config['editCurrentOnly'] = self.dialog.editCurrentOnly.isChecked()
|
||||
self.config['scrollToAnswer'] = self.dialog.scrollToAnswer.isChecked()
|
||||
i = 32
|
||||
try:
|
||||
i = int(self.dialog.toolbarIconSize.text())
|
||||
|
|
|
|||
|
|
@ -125,8 +125,9 @@ class View(object):
|
|||
|
||||
def onLoadFinished(self):
|
||||
if self.state == "showAnswer":
|
||||
mf = self.body.page().mainFrame()
|
||||
mf.evaluateJavaScript("location.hash = 'answer'")
|
||||
if self.main.config['scrollToAnswer']:
|
||||
mf = self.body.page().mainFrame()
|
||||
mf.evaluateJavaScript("location.hash = 'answer'")
|
||||
|
||||
# Top section
|
||||
##########################################################################
|
||||
|
|
|
|||
|
|
@ -441,6 +441,13 @@
|
|||
</property>
|
||||
</widget>
|
||||
</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>
|
||||
</item>
|
||||
<item>
|
||||
|
|
@ -502,6 +509,10 @@
|
|||
<tabstops>
|
||||
<tabstop>tabWidget</tabstop>
|
||||
<tabstop>interfaceLang</tabstop>
|
||||
<tabstop>interfaceFamily</tabstop>
|
||||
<tabstop>interfaceSize</tabstop>
|
||||
<tabstop>interfaceColour</tabstop>
|
||||
<tabstop>backgroundColour</tabstop>
|
||||
<tabstop>saveWhenClosing</tabstop>
|
||||
<tabstop>saveAfterEvery</tabstop>
|
||||
<tabstop>saveAfterEveryNum</tabstop>
|
||||
|
|
@ -520,6 +531,7 @@
|
|||
<tabstop>tallButtons</tabstop>
|
||||
<tabstop>showTray</tabstop>
|
||||
<tabstop>editCurrentOnly</tabstop>
|
||||
<tabstop>scrollToAnswer</tabstop>
|
||||
<tabstop>toolbarIconSize</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
|
|
|
|||
Loading…
Reference in a new issue