mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 20:48:56 +02:00
adding correct implementation of show password
This commit is contained in:
parent
030ee13f31
commit
565bf7f6bd
1 changed files with 7 additions and 7 deletions
|
@ -198,19 +198,23 @@ Item {
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: showPasswordHitbox
|
id: showPasswordHitbox
|
||||||
z: 10
|
z: 10
|
||||||
// x: parent.width - (parent.height * 31/16)
|
|
||||||
x: passwordField.width - ((passwordField.height) * 31 / 23)
|
x: passwordField.width - ((passwordField.height) * 31 / 23)
|
||||||
width: parent.width - (parent.width - (parent.height * 31/16))
|
width: parent.width - (parent.width - (parent.height * 31/16))
|
||||||
// width: passwordField.width - (passwordField.width - (((passwordField.height) * 31/23)))
|
|
||||||
height: parent.height
|
height: parent.height
|
||||||
|
anchors {
|
||||||
|
right: parent.right
|
||||||
|
}
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
id: showPasswordImage
|
id: showPasswordImage
|
||||||
// x: passwordField.width - ((passwordField.height) * 31 / 23)
|
|
||||||
y: (passwordField.height - (passwordField.height * 16 / 23)) / 2
|
y: (passwordField.height - (passwordField.height * 16 / 23)) / 2
|
||||||
width: passwordField.width - (passwordField.width - (((passwordField.height) * 31/23)))
|
width: passwordField.width - (passwordField.width - (((passwordField.height) * 31/23)))
|
||||||
height: passwordField.height * 16 / 23
|
height: passwordField.height * 16 / 23
|
||||||
|
anchors {
|
||||||
|
right: parent.right
|
||||||
|
rightMargin: 3
|
||||||
|
}
|
||||||
source: "../../images/eyeOpen.svg"
|
source: "../../images/eyeOpen.svg"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -223,12 +227,8 @@ Item {
|
||||||
showPassword = !showPassword;
|
showPassword = !showPassword;
|
||||||
passwordField.echoMode = showPassword ? TextInput.Normal : TextInput.Password;
|
passwordField.echoMode = showPassword ? TextInput.Normal : TextInput.Password;
|
||||||
showPasswordImage.source = showPassword ? "../../images/eyeClosed.svg" : "../../images/eyeOpen.svg";
|
showPasswordImage.source = showPassword ? "../../images/eyeClosed.svg" : "../../images/eyeOpen.svg";
|
||||||
showPasswordImage.width = passwordField.width - (passwordField.width - (passwordField.height * 31/23));
|
|
||||||
showPasswordImage.x = -(showPasswordImage.width - passwordField.width);
|
|
||||||
showPasswordImage.height = showPassword ? passwordField.height : passwordField.height * 16 / 23;
|
showPasswordImage.height = showPassword ? passwordField.height : passwordField.height * 16 / 23;
|
||||||
showPasswordImage.y = showPassword ? 0 : (passwordField.height - showPasswordImage.height) / 2;
|
showPasswordImage.y = showPassword ? 0 : (passwordField.height - showPasswordImage.height) / 2;
|
||||||
showPasswordHitbox.width = showPasswordImage.width;
|
|
||||||
showPasswordHitbox.x = showPasswordImage.x;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue