From d831395013694d8762d11e8e55540f8de789979a Mon Sep 17 00:00:00 2001 From: "moneromooo.monero" Date: Sun, 25 Dec 2016 22:56:57 +0000 Subject: [PATCH 1/2] WizardPassword: clamp displayed password strength to widget max --- wizard/WizardPassword.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wizard/WizardPassword.qml b/wizard/WizardPassword.qml index b591a332..58073132 100644 --- a/wizard/WizardPassword.qml +++ b/wizard/WizardPassword.qml @@ -84,9 +84,11 @@ Item { strength = 0 // use a slight parabola to discourage short passwords strength = strength ^ 1.2 / 3 + // mapScope does not clamp + if (strength > 100) + strength = 100 // privacyLevel component uses 1..13 scale privacyLevel.fillLevel = Utils.mapScope(1, 100, 1, 13, strength) - } From 1c5899731c681eef0624980a729a26bf8e62ca37 Mon Sep 17 00:00:00 2001 From: "moneromooo.monero" Date: Sun, 25 Dec 2016 22:57:32 +0000 Subject: [PATCH 2/2] WizardPasswordInput: update password strength on paste too --- wizard/WizardPasswordInput.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/wizard/WizardPasswordInput.qml b/wizard/WizardPasswordInput.qml index 00201ecf..62f27a3f 100644 --- a/wizard/WizardPasswordInput.qml +++ b/wizard/WizardPasswordInput.qml @@ -54,6 +54,7 @@ FocusScope { border.width: 0 } } + onTextChanged: changed(text) Keys.onReleased: { changed(text)