diff --git a/ankiqt/config.py b/ankiqt/config.py index 1422a7ba9..c4bc6673c 100644 --- a/ankiqt/config.py +++ b/ankiqt/config.py @@ -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): diff --git a/ankiqt/ui/preferences.py b/ankiqt/ui/preferences.py index aea07b09e..7dbf0930a 100644 --- a/ankiqt/ui/preferences.py +++ b/ankiqt/ui/preferences.py @@ -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()) diff --git a/ankiqt/ui/view.py b/ankiqt/ui/view.py index 703b0a1e3..ad561bc0a 100644 --- a/ankiqt/ui/view.py +++ b/ankiqt/ui/view.py @@ -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 ########################################################################## diff --git a/designer/preferences.ui b/designer/preferences.ui index 1664de0fa..60bbac0d2 100644 --- a/designer/preferences.ui +++ b/designer/preferences.ui @@ -441,6 +441,13 @@ + + + + Scroll down to the answer when showing answer + + + @@ -502,6 +509,10 @@ tabWidget interfaceLang + interfaceFamily + interfaceSize + interfaceColour + backgroundColour saveWhenClosing saveAfterEvery saveAfterEveryNum @@ -520,6 +531,7 @@ tallButtons showTray editCurrentOnly + scrollToAnswer toolbarIconSize buttonBox