From 26f5b9250cdbd1007e2196d8870ee37f5a260d38 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 10 Apr 2020 18:26:49 +1000 Subject: [PATCH] grey out spinner if max=0 https://anki.tenderapp.com/discussions/ankidesktop/32710-custom-study --- qt/aqt/customstudy.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qt/aqt/customstudy.py b/qt/aqt/customstudy.py index dd8b5b51b..5353b295a 100644 --- a/qt/aqt/customstudy.py +++ b/qt/aqt/customstudy.py @@ -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)