Tweak previewer navigation button display

This commit is contained in:
Glutanimate 2017-03-24 17:05:33 +01:00
parent 17d68cc957
commit 0bcf60fea6

View file

@ -1087,7 +1087,8 @@ where id in %s""" % ids2str(sf))
def _updatePreviewButtons(self): def _updatePreviewButtons(self):
if not self._previewWindow: if not self._previewWindow:
return return
canBack = self.currentRow() > 0 or self._previewState == "question" current = self.currentRow()
canBack = (current > 0 or (current == 0 and self._previewState == "answer" ))
self._previewPrev.setEnabled(not not (self.singleCard and canBack)) self._previewPrev.setEnabled(not not (self.singleCard and canBack))
canForward = self.currentRow() < self.model.rowCount(None) - 1 or \ canForward = self.currentRow() < self.model.rowCount(None) - 1 or \
self._previewState == "question" self._previewState == "question"