Index: sources/gui/qml/pages/UserConfirmation.qml =================================================================== diff -u -rea616a4cf7cfe191c33e66119cd5a71b5772192a -r6c6f1f5d466badd9b4fd67be7c907234c342b2a2 --- sources/gui/qml/pages/UserConfirmation.qml (.../UserConfirmation.qml) (revision ea616a4cf7cfe191c33e66119cd5a71b5772192a) +++ sources/gui/qml/pages/UserConfirmation.qml (.../UserConfirmation.qml) (revision 6c6f1f5d466badd9b4fd67be7c907234c342b2a2) @@ -1,15 +1,15 @@ /*! * - * Copyright (c) 2019-2020 Diality Inc. - All Rights Reserved. + * Copyright (c) 2021-2023 Diality Inc. - All Rights Reserved. * \copyright * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * \file UserConfirmation.qml * \author (last) Behrouz NematiPour - * \date (last) 24-May-2021 - * \author (original) Peter Lucia - * \date (original) 30-Nov-2019 + * \date (last) 03-Apr-2023 + * \author (original) Behrouz NematiPour + * \date (original) 11-May-2021 * */ @@ -29,43 +29,96 @@ SettingsBase { id: _root objectName : "UserConfirmation" // SquishQt testability - property bool isPassword: false - readonly property string password: _password.textInput.text - property alias message : _message.text - function clearPassword() { - _password.textInput.text = "" + property bool isPassword : false + property bool passwordChangeMode : false + readonly property string passwordCurrent : _passwordCurrent.textInput.text + readonly property string passwordUpdated : _passwordUpdated.textInput.text + readonly property string passwordConfirm : _passwordConfirm.textInput.text + property alias message : _message.text + + function clearPasswordCurrnet() { _passwordCurrent.textInput.text = "" } + function clearPasswordUpdated() { _passwordUpdated.textInput.text = "" } + function clearPasswordReEntry() { _passwordConfirm.textInput.text = "" } + function clearPasswords () { + clearPasswordCurrnet() + clearPasswordUpdated() + clearPasswordReEntry() } - firstFocusInput : isPassword ? _password : undefined - TextEntry { id : _password - clip : true - visible : _root.isPassword - label.text : qsTr("Password") - label .width : 150 - textInput .width : 450 + firstFocusInput : isPassword ? _passwordCurrent : undefined + + Column { + visible: isPassword + anchors { - top : parent.top - topMargin : topMarginContent + 120 // moved a little down to be more on center and close to keyboard top edge. - horizontalCenter: parent.horizontalCenter + top : parent.top + horizontalCenter : parent.horizontalCenter + topMargin : passwordChangeMode ? 0 : 120 } - textInput.inputMethodHints : Qt.ImhNone - textInput.echoMode : TextInput.Password - } - Image { id : _showPassword - visible : _password.visible - anchors.left : _password.right - anchors.leftMargin : Variables.minVGap - anchors.verticalCenter : _password.verticalCenter - width : Variables.iconsDiameter - height : Variables.iconsDiameter - source : "qrc:/images/iEye" + PasswordEntry { id: _passwordCurrent + label.text : ! passwordChangeMode ? "" : qsTr("Current") + label.width : ! passwordChangeMode ? 0 : labelWidth + nextInput : _passwordUpdated + anchors { + top : parent.top + topMargin : topMarginContent + horizontalCenter : parent.horizontalCenter + } + } + + PasswordEntry { id: _passwordUpdated + visible : passwordChangeMode + label.text : qsTr("New") + nextInput : _passwordConfirm + anchors { + top : _passwordCurrent.bottom + horizontalCenter : parent.horizontalCenter + } + } + + PasswordEntry { id: _passwordConfirm + visible : passwordChangeMode + label.text : qsTr("Confirm") + anchors { + top : _passwordUpdated.bottom + horizontalCenter : parent.horizontalCenter + } + } } + component PasswordEntry : Item { + property alias textInput : _passwordEntry.textInput + property alias nextInput : _passwordEntry.nextInput + property alias label : _passwordEntry.label + property int labelWidth : 150 - MouseArea { - anchors.fill: _showPassword - onPressed : _password.textInput.echoMode = TextInput.Normal - onReleased : _password.textInput.echoMode = TextInput.Password + height : 70 + label.width : labelWidth + + TextEntry { id: _passwordEntry + clip : true + textInput .width : 450 + textInput.inputMethodHints : Qt.ImhNone + textInput.echoMode : TextInput.Password + anchors.horizontalCenter : parent.horizontalCenter + } + + Image { + visible : _passwordEntry.visible + anchors.left : _passwordEntry.right + anchors.leftMargin : Variables.minVGap + anchors.verticalCenter : _passwordEntry.verticalCenter + width : Variables.iconsDiameter + height : Variables.iconsDiameter + source : "qrc:/images/iEye" + + MouseArea { + anchors.fill: parent + anchors.margins: -20 + onPressed : _passwordEntry.textInput.echoMode = TextInput.Normal + onReleased : _passwordEntry.textInput.echoMode = TextInput.Password + } + } } Text { id : _message