summary refs log tree commit diff
path: root/resources/qml
diff options
context:
space:
mode:
authorMarcus Hoffmann <bubu@bubu1.eu>2024-01-06 19:29:45 +0100
committerMarcus Hoffmann <bubu@bubu1.eu>2024-01-08 20:43:49 +0100
commitbfc05ba96e4ae0f50ce599eab0cb8f3d337492d7 (patch)
tree96c7e2c95c69e1c44a1d24f2c9e430e390e6195a /resources/qml
parentTranslated using Weblate (Portuguese (Portugal)) (diff)
downloadnheko-bfc05ba96e4ae0f50ce599eab0cb8f3d337492d7.tar.xz
LoginPage: add button to show/hide the password
Diffstat (limited to 'resources/qml')
-rw-r--r--resources/qml/pages/LoginPage.qml37
1 files changed, 29 insertions, 8 deletions
diff --git a/resources/qml/pages/LoginPage.qml b/resources/qml/pages/LoginPage.qml

index 86188918..8607b8dc 100644 --- a/resources/qml/pages/LoginPage.qml +++ b/resources/qml/pages/LoginPage.qml
@@ -82,15 +82,36 @@ Item { visible: text wrapMode: TextEdit.Wrap } + RowLayout { - MatrixTextField { - id: passwordLabel - Layout.fillWidth: true - label: qsTr("Password") - echoMode: TextInput.Password - ToolTip.text: qsTr("Your password.") - visible: login.passwordSupported - Keys.forwardTo: [pwBtn, ssoRepeater] + MatrixTextField { + id: passwordLabel + Layout.fillWidth: true + label: qsTr("Password") + echoMode: TextInput.Password + ToolTip.text: qsTr("Your password.") + visible: login.passwordSupported + Keys.forwardTo: [pwBtn, ssoRepeater] + } + + ImageButton { + id: showPwButton + Layout.preferredWidth: 30 + Layout.preferredHeight: 30 + visible: login.passwordSupported + Layout.alignment: Qt.AlignBottom + image: passwordLabel.echoMode === TextInput.Password ? ":/icons/icons/ui/eye-show.svg" : ":/icons/icons/ui/eye-hide.svg" + ToolTip.visible: hovered + ToolTip.text: qsTr("Show/Hide Password") + onClicked: { + if (passwordLabel.echoMode === TextInput.Normal) { + passwordLabel.echoMode = TextInput.Password + } + else { + passwordLabel.echoMode = TextInput.Normal + } + } + } } MatrixTextField {