blob: 0dffb49b6f33c2caccb9c42bac9af789909aad35 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
import QtQuick 2.15
import QtQuick.Controls 2.15
TextField {
id: field
property bool reveal: false
signal revealClicked()
implicitHeight: 52
leftPadding: 14
rightPadding: 46
echoMode: reveal ? TextInput.Normal : TextInput.Password
color: "#ffffff"
placeholderTextColor: "#5b6270"
font.pixelSize: 15
background: Rectangle {
radius: 7
color: "#303030"
border.color: field.activeFocus ? "#3d7839" : "#303030"
border.width: field.activeFocus ? 1.5 : 1
}
Text {
text: "\uD83D\uDC41"
font.pixelSize: 16
color: field.reveal ? "#3d7839" : "#9ca3af"
anchors.right: parent.right
anchors.rightMargin: 14
anchors.verticalCenter: parent.verticalCenter
}
MouseArea {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
width: 40
height: 40
cursorShape: Qt.PointingHandCursor
onClicked: field.revealClicked()
}
}
|