~emihalac/mnemosyne-proj/mnemosyne-proj

« back to all changes in this revision

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

  • Committer: Peter Bienstman
  • Date: 2017-03-01 18:28:52 UTC
  • Revision ID: peter.bienstman@ugent.be-20170301182852-uzlgodwicl505ft1
Option to have single window Q and A.

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
        return number_of_rows * max_img_height + 24
132
132
        
133
133
    def update_stretch_factors(self):
134
 
        if self.config()["optimise_Q_A_split"] == False:
 
134
        if self.config()["QA_split"] != "adaptive":
135
135
            return
136
136
        if 0: # Using prerendered html
137
137
            # Correct the required heights of question and answer for the
313
313
    def deactivate(self):
314
314
        self.stop_media()
315
315
           
316
 
    def focusInEvent(self, event):
317
 
        self.restore_focus()
318
 
        super().focusInEvent(event)    
 
316
    #def focusInEvent(self, event):
 
317
    #    self.restore_focus()
 
318
    #    super().focusInEvent(event)    
319
319
 
320
320
    def changeEvent(self, event):
321
321
        if hasattr(self, "show_button"):
439
439
        # After clicking on the question or the answer, that widget grabs the
440
440
        # focus, so that the keyboard shortcuts no longer work. This functions
441
441
        # is used to set the focus back to the correct widget.
442
 
        if self.focus_widget:
443
 
            self.focus_widget.setDefault(True)
444
 
            self.focus_widget.setFocus()
 
442
        if self.question.hasFocus() or self.answer.hasFocus():
 
443
            if self.focus_widget:
 
444
                self.focus_widget.setDefault(True)
 
445
                self.focus_widget.setFocus()
445
446
 
446
447
    def update_show_button(self, text, is_default, is_enabled):
447
448
        self.show_button.setText(text)