qml: introduce PasswordStrengthIndicator control, and add to PasswordDialog and WCWalletPassword
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Material
|
||||
|
||||
import "../controls"
|
||||
|
||||
@@ -13,7 +14,7 @@ WizardComponent {
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
width: parent.width
|
||||
anchors.fill: parent
|
||||
|
||||
Label {
|
||||
Layout.fillWidth: true
|
||||
@@ -22,17 +23,50 @@ WizardComponent {
|
||||
: qsTr('Enter password for %1').arg(wizard_data['wallet_name'])
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
|
||||
PasswordField {
|
||||
id: password1
|
||||
}
|
||||
|
||||
Label {
|
||||
text: qsTr('Enter password (again)')
|
||||
}
|
||||
|
||||
PasswordField {
|
||||
id: password2
|
||||
showReveal: false
|
||||
echoMode: password1.echoMode
|
||||
enabled: password1.text.length >= 6
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: constants.paddingXLarge
|
||||
Layout.rightMargin: constants.paddingXLarge
|
||||
Layout.topMargin: constants.paddingXLarge
|
||||
|
||||
visible: password1.text != ''
|
||||
|
||||
Label {
|
||||
Layout.rightMargin: constants.paddingLarge
|
||||
text: qsTr('Strength')
|
||||
}
|
||||
|
||||
PasswordStrengthIndicator {
|
||||
Layout.fillWidth: true
|
||||
password: password1.text
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
Layout.preferredWidth: 1
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
InfoTextArea {
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
text: qsTr('Passwords don\'t match')
|
||||
visible: password1.text != password2.text
|
||||
iconStyle: InfoTextArea.IconStyle.Warn
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user