Use a SpinBox for more appropriate UI/UX when entering token lengths

Due to our use of liboath for generating the actual tokens, we also support only a limited range of valid token lengths.
This means that it is more user friendly to express those limits  directly in the UI through a SpinBox instead of allowing the user type in values we do not currently support.
master
Johan Ouwerkerk 2019-09-28 00:22:55 +02:00
parent 29e9348097
commit 8d40008201
1 changed files with 11 additions and 5 deletions

View File

@ -201,12 +201,18 @@ Kirigami.ApplicationWindow {
inputMask: "0009"
inputMethodHints: Qt.ImhDigitsOnly
}
Controls.TextField {
/*
* The liboath API is documented to support tokens which are
* 6, 7 or 8 characters long only.
*
* Make a virtue of it by offering a spinner for better UX
*/
Controls.SpinBox {
id: pinLengthField
Kirigami.FormData.label: "Pin length:"
text: "6"
inputMask: "0D"
inputMethodHints: Qt.ImhDigitsOnly
Kirigami.FormData.label: "Token length:"
from: 6
to: 8
value: 6
}
}
}