-
Notifications
You must be signed in to change notification settings - Fork 1
/
RestorePage.qml
148 lines (125 loc) · 3.96 KB
/
RestorePage.qml
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
import QtQuick 2.7
import QtQuick.Controls 2.2
import "DefaultTheme.js" as DefTheme
WelcomeBrandPage {
id: rootItem
signal register()
signal signIn()
signal resetPassword()
hintText: currentUser.lastMessage
hintColor: currentUser.failed ? DefTheme.mainNegativeAccent : (currentUser.ready ? DefTheme.mainPositiveAccent : DefTheme.mainNeutralAccent)
Connections {
target: currentUser
onRestoreRequestSent: resetPassword()
}
Column {
id: controlsColumn
width: parent.width * 0.75
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.verticalCenter
Rectangle {
id: emailRow
height: rootItem.height * 0.08
width: parent.width
color: "#00000000"
Item {
id: emailIcon
height: parent.height / 2
width: height
anchors.verticalCenter: parent.verticalCenter
x: 10
Image {
id: emailPic
height: parent.height
width: parent.width
source: "img/003-black-back-closed-envelope-shape.svg"
anchors.centerIn: parent
}
}
TextInput {
id: emailInput
anchors.left: emailIcon.right
anchors.right: parent.right
anchors.rightMargin: 10
height: emailIcon.height
horizontalAlignment: Text.AlignHCenter
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: parent.height / 3
font.capitalization: Font.AllLowercase
Text {
anchors.fill: parent
visible: !(parent.focus || parent.text.length > 0)
color: "#b1b1b1"
text: "enter your email"
verticalAlignment: Text.AlignVCenter
font.italic: true
horizontalAlignment: Text.AlignHCenter
}
inputMethodHints: Qt.ImhNoPredictiveText || Qt.ImhEmailCharactersOnly
onDisplayTextChanged: {
currentUser.email = text
currentUser.checkEmail()
}
}
Rectangle {
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: emailInput.bottom
anchors.topMargin: 2
width: parent.width - 20
height: 2
color: "#000000"
}
}
}
Column {
id: column
width: parent.width * 0.75
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: DefTheme.buttonHeight / 3
ActionButton {
id: signUpButton
width: parent.width
text: "RESTORE"
enabled: currentUser.ready
onClicked: currentUser.restorePassword()
}
Item {
width: parent.width
height: DefTheme.buttonHeight / 3
}
SmallButton {
id: restoreButton
anchors.right: parent.right
text: "REGISTER ACCOUNT"
onClicked: register()
}
Item {
width: parent.width
height: DefTheme.buttonHeight / 3
}
SmallButton {
id: registerButton
anchors.right: parent.right
text: "SIGN IN"
onClicked: signIn()
}
}
Item {
id: busyPane
visible: currentUser.busy
anchors.fill: parent
Rectangle {
anchors.fill: parent
opacity: 0.7
}
BusyIndicator {
id: busyIndicator
anchors.centerIn: parent
}
MouseArea {
anchors.fill: parent
onClicked: {}
}
}
}