blob: 88fc0cfeaf51e36dbd27da646658eb778c1bb2c2 (
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
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
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
|
import QtQuick 2.0
import SddmComponents 2.0
Rectangle {
id: root
property int sessionIndex: session.index
property string fontFamily: config.font ? config.font : "FiraCode Nerd Font"
property color bg: "#282828"
property color bg1: "#3c3836"
property color bg2: "#504945"
property color bg3: "#665c54"
property color fg: "#ebdbb2"
property color fg1: "#d5c4a1"
property color red: "#cc241d"
property color green: "#98971a"
property color yellow: "#d79921"
property color orange: "#d65d0e"
property color purple: "#b16286"
property color aqua: "#689d6a"
property string clockText: Qt.formatDateTime(new Date(), "hh:mm ddd dd MMM")
width: 1920
height: 1080
color: bg
Component.onCompleted: {
if (name.text == "")
name.focus = true;
else
password.focus = true;
}
TextConstants {
id: textConstants
}
Connections {
function onLoginSucceeded() {
promptMessage.text = textConstants.loginSucceeded;
promptMessage.color = green;
}
function onLoginFailed() {
password.text = "";
promptMessage.text = textConstants.loginFailed;
promptMessage.color = red;
}
function onInformationMessage(message) {
promptMessage.text = message;
promptMessage.color = orange;
}
target: sddm
}
Timer {
interval: 1000
running: true
repeat: true
onTriggered: root.clockText = Qt.formatDateTime(new Date(), "hh:mm ddd dd MMM")
}
Background {
anchors.fill: parent
source: config.background
fillMode: Image.PreserveAspectCrop
}
Rectangle {
anchors.fill: parent
color: "#99282828"
}
Rectangle {
id: topbar
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
height: 42
color: bg
Rectangle {
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
height: 1
color: bg2
}
Text {
anchors.left: parent.left
anchors.leftMargin: 16
anchors.verticalCenter: parent.verticalCenter
text: "void / i3"
color: yellow
font.family: fontFamily
font.pixelSize: 14
font.bold: true
}
Text {
anchors.right: parent.right
anchors.rightMargin: 16
anchors.verticalCenter: parent.verticalCenter
text: root.clockText
color: fg
font.family: fontFamily
font.pixelSize: 13
font.bold: true
}
}
Rectangle {
id: panel
width: Math.min(430, parent.width - 80)
height: 356
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
radius: 6
color: "#e6282828"
border.width: 1
border.color: bg3
Column {
anchors.fill: parent
anchors.margins: 22
spacing: 12
Text {
width: parent.width
text: textConstants.welcomeText.arg(sddm.hostName)
color: fg
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
font.family: fontFamily
font.pixelSize: 18
font.bold: true
}
Text {
width: parent.width
text: textConstants.userName
color: fg1
font.family: fontFamily
font.pixelSize: 12
font.bold: true
}
TextBox {
id: name
width: parent.width
height: 34
text: userModel.lastUser
color: bg1
borderColor: bg3
focusColor: yellow
hoverColor: aqua
textColor: fg
radius: 4
font.family: fontFamily
font.pixelSize: 14
KeyNavigation.backtab: rebootButton
KeyNavigation.tab: password
Keys.onPressed: {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
sddm.login(name.text, password.text, sessionIndex);
event.accepted = true;
}
}
}
Text {
width: parent.width
text: textConstants.password
color: fg1
font.family: fontFamily
font.pixelSize: 12
font.bold: true
}
PasswordBox {
id: password
width: parent.width
height: 34
color: bg1
borderColor: bg3
focusColor: yellow
hoverColor: aqua
textColor: fg
radius: 4
font.family: fontFamily
font.pixelSize: 14
tooltipFG: fg
tooltipBG: bg1
KeyNavigation.backtab: name
KeyNavigation.tab: session
Keys.onPressed: {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
sddm.login(name.text, password.text, sessionIndex);
event.accepted = true;
}
}
}
Row {
width: parent.width
height: 34
spacing: 10
ComboBox {
id: session
width: Math.floor((parent.width - parent.spacing) * 0.62)
height: parent.height
model: sessionModel
index: sessionModel.lastIndex
color: bg1
menuColor: bg1
borderColor: bg3
focusColor: yellow
hoverColor: aqua
textColor: fg
arrowColor: bg2
font.family: fontFamily
font.pixelSize: 13
KeyNavigation.backtab: password
KeyNavigation.tab: layoutBox
}
LayoutBox {
id: layoutBox
width: parent.width - session.width - parent.spacing
height: parent.height
color: bg1
menuColor: bg1
borderColor: bg3
focusColor: yellow
hoverColor: aqua
textColor: fg
arrowColor: bg2
font.family: fontFamily
font.pixelSize: 13
KeyNavigation.backtab: session
KeyNavigation.tab: loginButton
}
}
Text {
id: promptMessage
width: parent.width
height: 18
text: textConstants.prompt
color: fg1
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
font.family: fontFamily
font.pixelSize: 11
}
Row {
width: parent.width
height: 34
spacing: 8
Button {
id: loginButton
width: Math.floor((parent.width - (parent.spacing * 2)) / 3)
height: parent.height
text: textConstants.login
color: yellow
activeColor: orange
pressedColor: green
textColor: bg
font.family: fontFamily
font.pixelSize: 13
onClicked: sddm.login(name.text, password.text, sessionIndex)
KeyNavigation.backtab: layoutBox
KeyNavigation.tab: shutdownButton
}
Button {
id: shutdownButton
width: loginButton.width
height: parent.height
text: textConstants.shutdown
color: bg2
activeColor: red
pressedColor: red
textColor: fg
font.family: fontFamily
font.pixelSize: 13
onClicked: sddm.powerOff()
KeyNavigation.backtab: loginButton
KeyNavigation.tab: rebootButton
}
Button {
id: rebootButton
width: parent.width - loginButton.width - shutdownButton.width - (parent.spacing * 2)
height: parent.height
text: textConstants.reboot
color: bg2
activeColor: orange
pressedColor: orange
textColor: fg
font.family: fontFamily
font.pixelSize: 13
onClicked: sddm.reboot()
KeyNavigation.backtab: shutdownButton
KeyNavigation.tab: name
}
}
}
}
}
|