mirror of
https://github.com/monero-project/monero-gui.git
synced 2025-01-06 01:42:06 +02:00
PasswordDialog: add ability to toggle text echo mode 💄 ✨
This commit is contained in:
parent
0f05127262
commit
fa0c691666
@ -40,6 +40,7 @@ Item {
|
|||||||
visible: false
|
visible: false
|
||||||
z: parent.z + 2
|
z: parent.z + 2
|
||||||
|
|
||||||
|
property bool isHidden: true
|
||||||
property alias password: passwordInput.text
|
property alias password: passwordInput.text
|
||||||
property string walletName
|
property string walletName
|
||||||
property string errorText
|
property string errorText
|
||||||
@ -136,12 +137,33 @@ Item {
|
|||||||
color: "black"
|
color: "black"
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
width: 12
|
width: 26 * scaleRatio
|
||||||
height: 16
|
height: 26 * scaleRatio
|
||||||
source: "../images/lockIcon.png"
|
opacity: 0.7
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
source: isHidden ? "../images/eyeShow.png" : "../images/eyeHide.png"
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: 20
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
images/eyeHide.png
Normal file
BIN
images/eyeHide.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.7 KiB |
BIN
images/eyeShow.png
Normal file
BIN
images/eyeShow.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.8 KiB |
2
qml.qrc
2
qml.qrc
@ -226,5 +226,7 @@
|
|||||||
<file>images/settings_navbar_side_active.png</file>
|
<file>images/settings_navbar_side_active.png</file>
|
||||||
<file>images/settings_local.png</file>
|
<file>images/settings_local.png</file>
|
||||||
<file>components/WarningBox.qml</file>
|
<file>components/WarningBox.qml</file>
|
||||||
|
<file>images/eyeHide.png</file>
|
||||||
|
<file>images/eyeShow.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
Loading…
Reference in New Issue
Block a user