diff options
| author | mmbyday <bromark@protonmail.com> | 2018-12-07 13:00:41 -0500 |
|---|---|---|
| committer | mmbyday <bromark@protonmail.com> | 2018-12-10 09:14:01 -0800 |
| commit | fa0c691666c24153d49dcb9ff23afce4e3381c4c (patch) | |
| tree | 1a8353ef2f50013f198d2ed7d61c27cf1097f0cf /components | |
| parent | 0f05127262cf662ab549deae426c9deebf77967e (diff) | |
| download | monzero-gui-fa0c691666c24153d49dcb9ff23afce4e3381c4c.tar.gz monzero-gui-fa0c691666c24153d49dcb9ff23afce4e3381c4c.tar.xz monzero-gui-fa0c691666c24153d49dcb9ff23afce4e3381c4c.zip | |
PasswordDialog: add ability to toggle text echo mode :lipstick: :sparkles:
Diffstat (limited to 'components')
| -rw-r--r-- | components/PasswordDialog.qml | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/components/PasswordDialog.qml b/components/PasswordDialog.qml index 230db37f..d0f442e4 100644 --- a/components/PasswordDialog.qml +++ b/components/PasswordDialog.qml @@ -40,6 +40,7 @@ Item { visible: false z: parent.z + 2 + property bool isHidden: true property alias password: passwordInput.text property string walletName property string errorText @@ -136,12 +137,33 @@ Item { color: "black" Image { - width: 12 - height: 16 - source: "../images/lockIcon.png" + width: 26 * scaleRatio + height: 26 * scaleRatio + opacity: 0.7 + fillMode: Image.PreserveAspectFit + source: isHidden ? "../images/eyeShow.png" : "../images/eyeHide.png" anchors.verticalCenter: parent.verticalCenter anchors.right: parent.right anchors.rightMargin: 20 + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + hoverEnabled: true + onClicked: { + passwordInput.echoMode = isHidden ? TextInput.Normal : TextInput.Password; + isHidden = !isHidden; + } + onEntered: { + parent.opacity = 0.9 + parent.width = 28 * scaleRatio + parent.height = 28 * scaleRatio + } + onExited: { + parent.opacity = 0.7 + parent.width = 26 * scaleRatio + parent.height = 26 * scaleRatio + } + } } } |
