-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.qml
More file actions
executable file
·167 lines (143 loc) · 4.31 KB
/
main.qml
File metadata and controls
executable file
·167 lines (143 loc) · 4.31 KB
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
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
import QtQuick 2.5
import QtQuick.Window 2.2
import "Components"
App {
id: main
visible: true
width: Screen.width
height: Screen.height
title: qsTr("Emmi Greeter")
//flags: Qt.FramelessWindowHint
property int efeito1: 300
MainForm {
id: mainForm
anchors.fill: parent
property bool show: true
Label {
x: (mainForm.width - width) - 40
y: (mainForm.height - height) - 130
text: Context.date()
color: "#fff"
size: 18
opacity: 0.8
}
Label {
x: (mainForm.width - width) - 70
y: (mainForm.height - height) - 40
text: Context.time().split("-")[0]
color: "#fff"
size: 78
opacity: 0.7
}
Label {
x: (mainForm.width - width) - 40
y: (mainForm.height - height) - 55
text: Context.time().split("-")[1]
color: "#fff"
size: 18
opacity: 0.8
}
Rectangle {
id: menu
x: parent.width
y: 0
width: 200
height: parent.height
color: "transparent"
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked: {
sessions.unfocus()
users.unfocus()
}
onExited: {
menu.x = mainForm.width
show = true
sessions.unfocus()
users.unfocus()
}
}
Rectangle {
anchors.fill: parent
opacity: 0.5
color: "#000"
}
Label {x: 12; y: 100; text: 'Session:'; size: 14; color: "#fff"}
SelectList {
id: sessions
selected.text: Context.lastSession()
y: 118
x: 12
height: 30
initial: 30
max: 30
width: menu.width - 20
lista: Context.sessions()
onChange: {
Context.session(value)
}
}
Label {x: 12; y: 130 + sessions.height; text: 'User:'; size: 14; color: "#fff"}
SelectList {
id: users
selected.text: Context.lastUser()
y: 148 + sessions.height
x: 12
height: 30
initial: 30
max: 30
width: menu.width - 20
lista: Context.users()
onChange: {
mainForm.imgUser.source = "file:///usr/share/emmi-greeter/users/" + value + ".jpg"
Context.userChange(value)
}
Component.onCompleted: {
Context.userChange(Context.lastUser())
}
}
Label {
x: (parent.width / 2) - (width / 2)
y: parent.height - (height + 20)
text: "\uf011"
font.family: "Font Awesome 5 Free"
MouseArea {
anchors.fill: parent
onClicked: {
Context.power()
}
}
}
}
Rectangle {
x: parent.width - 36
y: 10
width: 24
height: 26
color: "transparent"
z: 9
Rectangle {x: 0; y: 3; width: parent.width; height: 3}
Rectangle {x: 0; y: 11; width: parent.width; height: 3}
Rectangle {x: 0; y: 19; width: parent.width; height: 3}
MouseArea {
anchors.fill: parent
onClicked: {
if (show) {
menu.x = mainForm.width - 200
show = false
} else {
menu.x = mainForm.width
show = true
}
sessions.unfocus()
users.unfocus()
}
}
}
}
function clearPassword() {
mainForm.textPassword.text = ""
mainForm.textPassword.setFocus()
}
}