-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.qml
115 lines (107 loc) · 3.4 KB
/
Main.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
import QtQuick 2.5
import QtQuick.Layouts 1.2
import QtQuick.Controls 1.4 as Qqc
import QtQuick.Controls.Styles 1.4
import SddmComponents 2.0
Rectangle {
color: "black"
width: Window.width
height: Window.height
Connections {
target: sddm
}
ColumnLayout {
AnimatedImage{
Layout.alignment: Qt.AlignCenter
Layout.topMargin: 2
Layout.preferredWidth: 500
Layout.preferredHeight: 500
source: "WiredLogin.gif"
}
width: parent.width
height: parent.height
Qqc.Label {
Layout.alignment: Qt.AlignCenter
text: "User ID : "
color: "#c1b492"
font.pixelSize: 16
}
Qqc.TextField {
id: username
Layout.alignment: Qt.AlignCenter
text: userModel.lastUser
horizontalAlignment: Text.AlignHCenter
style: TextFieldStyle {
textColor: "#c1b492"
background: Rectangle {
color: "transparent"
implicitWidth: 200
border.color: "#c1b492"
}
}
KeyNavigation.backtab: shutdownBtn; KeyNavigation.tab: password
Keys.onPressed: {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
sddm.login(username.text, password.text, 0) // Use a default session index (0)
event.accepted = true
}
}
}
Qqc.Label {
Layout.alignment: Qt.AlignCenter
text: "Password:"
color: "#c1b492"
font.pixelSize: 16
}
Qqc.TextField {
id: password
echoMode: TextInput.Password
Layout.alignment: Qt.AlignCenter
horizontalAlignment: Text.AlignHCenter
style: TextFieldStyle {
textColor: "#c1b492"
background: Rectangle {
color: "transparent"
implicitWidth: 200
border.color: "#c1b492"
}
}
KeyNavigation.backtab: username; KeyNavigation.tab: null
Keys.onPressed: {
if (event.key === Qt.Key_Return || event.key === Qt.Key_Enter) {
sddm.login(username.text, password.text, 0) // Use a default session index (0)
event.accepted = true
}
}
}
ColumnLayout {
Layout.alignment: Qt.AlignCenter
Layout.topMargin: 14
Layout.bottomMargin: 50
width: 100
Rectangle {
anchors.fill: parent
color: "transparent"
border.color: "#c1b492"
radius: 30
}
Qqc.Label {
Layout.alignment: Qt.AlignCenter
text: "Login"
color: "#c1b492"
font.pixelSize: 16
}
MouseArea {
anchors.fill: parent
onClicked: sddm.login(username.text, password.text, 0) // Use a default session index (0)
}
}
}
Component.onCompleted: {
if (username.text == "") {
username.focus = true
} else {
password.focus = true
}
}
}