grey out spinner if max=0

https://anki.tenderapp.com/discussions/ankidesktop/32710-custom-study
This commit is contained in:
Damien Elmes 2020-04-10 18:26:49 +10:00
parent 6776101601
commit 26f5b9250c

View File

@ -109,6 +109,10 @@ class CustomStudy(QDialog):
f.title.setVisible(not not tit)
f.spin.setMinimum(smin)
f.spin.setMaximum(smax)
if smax > 0:
f.spin.setEnabled(True)
else:
f.spin.setEnabled(False)
f.spin.setValue(sval)
f.preSpin.setText(pre)
f.postSpin.setText(post)