diff options
| -rw-r--r-- | components/PasswordDialog.qml | 28 | ||||
| -rw-r--r-- | images/eyeHide.png | bin | 0 -> 7840 bytes | |||
| -rw-r--r-- | images/eyeShow.png | bin | 0 -> 7005 bytes | |||
| -rw-r--r-- | qml.qrc | 2 |
4 files changed, 27 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 + } + } } } diff --git a/images/eyeHide.png b/images/eyeHide.png Binary files differnew file mode 100644 index 00000000..63a441f3 --- /dev/null +++ b/images/eyeHide.png diff --git a/images/eyeShow.png b/images/eyeShow.png Binary files differnew file mode 100644 index 00000000..d4ad64a4 --- /dev/null +++ b/images/eyeShow.png @@ -226,5 +226,7 @@ <file>images/settings_navbar_side_active.png</file> <file>images/settings_local.png</file> <file>components/WarningBox.qml</file> + <file>images/eyeHide.png</file> + <file>images/eyeShow.png</file> </qresource> </RCC> |
