61
Component.onCompleted: {
62
setTabOrder([usersList, loginButtonItem, sessionButton, suspendButton, hibernateButton, restartButton, shutdownButton]);
63
usersList.forceActiveFocus();
66
function setTabOrder(lst) {
68
var lastIdx = lst.length - 1;
69
for (idx = 0; idx <= lastIdx; ++idx) {
71
item.KeyNavigation.backtab = lst[idx > 0 ? idx - 1 : lastIdx];
72
item.KeyNavigation.tab = lst[idx < lastIdx ? idx + 1 : 0];
76
PlasmaComponents.Label {
59
78
anchors.horizontalCenter: parent.horizontalCenter
60
79
anchors.top: parent.top
62
82
text: i18n("Welcome to %1", greeter.hostname);
101
124
PlasmaCore.FrameSvgItem {
128
leftMargin: -margins.left
129
topMargin: -margins.top
130
bottomMargin: -margins.bottom
131
rightMargin: -margins.right
133
imagePath: "widgets/button"
135
visible: wrapper.isCurrent
136
opacity: wrapper.activeFocus ? 1 : 0
137
Behavior on opacity {
138
NumberAnimation { duration: 100 }
142
PlasmaCore.FrameSvgItem {
102
144
anchors.centerIn: face
103
145
width: face.width + padding * 2
104
146
height: face.height + padding * 2
105
imagePath: "opaque/dialogs/background"
147
imagePath: "widgets/lineedit"
149
enabledBorders: "NoBorder"
152
PlasmaCore.FrameSvgItem {
155
imagePath: "widgets/lineedit"
157
opacity: (mouseArea.containsMouse && !(wrapper.isCurrent && wrapper.activeFocus)) ? 1 : 0
158
Behavior on opacity {
159
NumberAnimation { duration: 100 }
126
182
anchors.fill: parent
128
onClicked: wrapper.ListView.view.currentIndex = index;
185
wrapper.ListView.view.currentIndex = index;
186
wrapper.ListView.view.forceActiveFocus();
133
192
function startLogin() {
134
193
var username = usersList.currentItem.username;
135
if (username == "*guest") {
194
if (username == guestLogin) {
136
195
greeter.authenticateAsGuest();
138
197
greeter.authenticate(username);
142
// Central item. This item is used to position the main items in the screen.
144
property int widgetHeight: 30
146
anchors.horizontalCenter: parent.horizontalCenter
147
/* Hack: we want to have 1/3 space above and 2/3 space below the main
148
* items. We could use (parent.height - childrenRect.height) / 3 but
149
* that causes the view to move down when selecting the guest session
150
* because childrenRect.height decreases. Instead we compute a static
151
* height for our items.
155
+ fixedWidgetsColumn.anchors.topMargin
157
+ 2 * fixedWidgetsColumn.spacing
204
horizontalCenter: parent.horizontalCenter
205
bottom: loginButtonItem.top
159
208
width: parent.width
163
anchors.horizontalCenter: parent.horizontalCenter
167
height: userItemHeight
171
cacheBuffer: count * 80
173
delegate: userDelegate
175
orientation: ListView.Horizontal
177
highlightRangeMode: ListView.StrictlyEnforceRange
178
preferredHighlightBegin: width / 2 - userItemWidth / 2
179
preferredHighlightEnd: width / 2 + userItemWidth / 2
209
height: userItemHeight
213
cacheBuffer: count * 80
215
delegate: userDelegate
217
orientation: ListView.Horizontal
219
highlightRangeMode: ListView.StrictlyEnforceRange
220
preferredHighlightBegin: width / 2 - userItemWidth / 2
221
preferredHighlightEnd: width / 2 + userItemWidth / 2
227
horizontalCenter: parent.horizontalCenter
228
bottom: parent.verticalCenter
184
id: fixedWidgetsColumn
185
anchors.top: usersList.bottom
232
property bool isGuestLogin: usersList.currentItem.username == guestLogin
234
/*PlasmaComponents.*/TextField {
186
236
anchors.horizontalCenter: parent.horizontalCenter
188
anchors.topMargin: 2 * padding
191
LightDMPlasmaWidgets.PasswordLineEdit {
195
clickMessage: i18n("Password")
196
onReturnPressed: startLogin();
197
visible: usersList.currentItem.username != "*guest"
200
LightDMPlasmaWidgets.ModelComboBox {
205
currentIndex: indexForData(usersList.currentItem.usersession, sessionsModel.key)
208
PlasmaWidgets.PushButton {
238
height: parent.height
239
focus: !loginButtonItem.isGuestLogin
240
opacity: loginButtonItem.isGuestLogin ? 0 : 1
242
echoMode: TextInput.Password
243
placeholderText: i18n("Password")
244
onAccepted: startLogin();
246
PlasmaComponents.ToolButton {
210
anchors.horizontalCenter: parent.horizontalCenter
251
verticalCenter: parent.verticalCenter
256
iconSource: "go-jump-locationbar"
213
257
onClicked: startLogin();
218
// Bottom "Settings" bar
260
Behavior on opacity {
261
NumberAnimation { duration: 100 }
265
PlasmaComponents.Button {
267
anchors.horizontalCenter: parent.horizontalCenter
268
width: userFaceSize + 2 * padding
269
height: parent.height
270
focus: loginButtonItem.isGuestLogin
271
opacity: 1 - passwordInput.opacity
273
iconSource: loginButton.iconSource
275
onClicked: startLogin();
277
Behavior on opacity {
278
NumberAnimation { duration: 100 }
286
top: loginButtonItem.bottom
289
horizontalCenter: parent.horizontalCenter
294
currentIndex: indexForData(usersList.currentItem.usersession)
297
// Bottom "Power" bar
219
298
PlasmaCore.FrameSvgItem {
220
300
anchors.bottom: parent.bottom
221
301
anchors.right: parent.right
222
302
width: childrenRect.width + margins.left
224
304
imagePath: "translucent/widgets/panel-background"
225
305
prefix: "south-mini"
227
// Hack to hide left and bottom corners. Tried to use enabledBorders but failed.
228
anchors.rightMargin: -margins.right
229
anchors.bottomMargin: -margins.bottom
307
enabledBorders: "LeftBorder|TopBorder"
233
311
x: parent.margins.left
234
312
y: parent.margins.top
314
/*PlasmaComponents.*/ToolButton {
237
316
text: i18n("Suspend")
238
icon: QIcon("system-suspend")
317
iconSource: "system-suspend"
239
318
enabled: power.canSuspend;
240
319
onClicked: power.suspend();
322
/*PlasmaComponents.*/ToolButton {
244
324
text: i18n("Hibernate")
245
icon: QIcon("system-suspend-hibernate")
325
iconSource: "system-suspend-hibernate"
246
326
enabled: power.canHibernate
247
327
onClicked: power.hibernate();
330
/*PlasmaComponents.*/ToolButton {
251
332
text: i18n("Restart")
252
icon: QIcon("system-reboot")
333
iconSource: "system-reboot"
253
334
enabled: power.canRestart
254
335
onClicked: power.restart();
338
/*PlasmaComponents.*/ToolButton {
258
340
text: i18n("Shutdown")
259
icon: QIcon("system-shutdown")
341
iconSource: "system-shutdown"
260
342
enabled: power.canShutdown
261
343
onClicked: power.shutDown();