~kevang/mnemosyne-proj/grade-shortcuts-improvements

« back to all changes in this revision

Viewing changes to mnemosyne/mnemosyne/pyqt_ui/review_wdgt.py

  • Committer: Peter.Bienstman at UGent
  • Date: 2015-04-13 13:30:01 UTC
  • Revision ID: peter.bienstman@ugent.be-20150413133001-q8dwt76k8c3fcmn1
TagĀ 2.3.3.

Show diffs side-by-side

added added

removed removed

Lines of Context:
133
133
                    answer_stretch = required_answer_height
134
134
                    question_stretch = total_height_available - answer_stretch
135
135
                    if question_stretch < 50:
136
 
                        question_stretch = 50
 
136
                        question_stretch = 50        
137
137
        self.vertical_layout.setStretchFactor(\
138
138
            self.question_box, question_stretch + self.stretch_offset)
139
139
        self.vertical_layout.setStretchFactor(\
276
276
        </td></tr></table></body></html>"""
277
277
 
278
278
    def scroll_down(self):
279
 
        if self.review_controller().is_question_showing():
 
279
        if self.review_controller().is_question_showing() or \
 
280
           self.review_controller().card.fact_view.a_on_top_of_q:
280
281
            frame = self.question.page().mainFrame()
281
282
        else:
282
283
            frame = self.answer.page().mainFrame()
286
287
        frame.evaluateJavaScript("window.scrollTo(%d, %d);" % (x, y))
287
288
 
288
289
    def scroll_up(self):
289
 
        if self.review_controller().is_question_showing():
 
290
        if self.review_controller().is_question_showing() or \
 
291
           self.review_controller().card.fact_view.a_on_top_of_q:
290
292
            frame = self.question.page().mainFrame()
291
293
        else:
292
294
            frame = self.answer.page().mainFrame()
296
298
        frame.evaluateJavaScript("window.scrollTo(%d, %d);" % (x, y))
297
299
 
298
300
    def copy(self):
299
 
        if self.review_controller().is_question_showing():
 
301
        if self.review_controller().is_question_showing() or \
 
302
           self.review_controller().card.fact_view.a_on_top_of_q:
300
303
            webview = self.question
301
304
        else:
302
305
            webview = self.answer