blob: 2a2e57e086771578d68c3786ae943f5d5f6ac3cb (
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
import QtQuick 2.15
import QtQuick.Controls 2.15
import "."
TextField {
id: field
property bool reveal: false
property string revealName: ""
property bool highlight: false
signal revealClicked()
implicitHeight: 44
leftPadding: 12
rightPadding: 44
echoMode: reveal ? TextInput.Normal : TextInput.Password
color: Stilus.szoveg
placeholderTextColor: Stilus.szovegHalvany
font.family: Stilus.font
font.pixelSize: 14
background: Rectangle {
color: Stilus.felulet
border.width: 1
border.color: field.activeFocus || field.highlight ? Stilus.zold : Stilus.keretErosebb
}
Button {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
width: 44
height: 44
padding: 0
focusPolicy: Qt.NoFocus
Accessible.name: field.revealName
background: Item {}
contentItem: Canvas {
property bool aktiv: field.reveal
onAktivChanged: requestPaint()
onPaint: {
var c = getContext("2d")
c.reset()
c.strokeStyle = aktiv ? Stilus.zold : Stilus.szovegHalvany
c.lineWidth = 2
c.beginPath()
c.moveTo(12, 22)
c.quadraticCurveTo(22, 12, 32, 22)
c.quadraticCurveTo(22, 32, 12, 22)
c.stroke()
c.beginPath()
c.arc(22, 22, 3, 0, 2 * Math.PI)
c.stroke()
}
}
onClicked: field.revealClicked()
}
}
|