Changeset View
Changeset View
Standalone View
Standalone View
sddm-theme/Main.qml
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 56 | Background { | |||
---|---|---|---|---|---|
57 | x: geometry.x; y: geometry.y; width: geometry.width; height: geometry.height | 57 | x: geometry.x; y: geometry.y; width: geometry.width; height: geometry.height | ||
58 | sceneBackgroundType: config.type | 58 | sceneBackgroundType: config.type | ||
59 | sceneBackgroundColor: config.color | 59 | sceneBackgroundColor: config.color | ||
60 | sceneBackgroundImage: config.background | 60 | sceneBackgroundImage: config.background | ||
61 | } | 61 | } | ||
62 | } | 62 | } | ||
63 | } | 63 | } | ||
64 | 64 | | |||
65 | MouseArea { | | |||
66 | id: loginScreenRoot | | |||
67 | anchors.fill: parent | | |||
68 | | ||||
69 | property bool uiVisible: true | | |||
70 | property bool blockUI: mainStack.depth > 1 || userListComponent.mainPasswordBox.text.length > 0 || inputPanel.keyboardActive || config.type != "image" | | |||
71 | | ||||
72 | hoverEnabled: true | | |||
73 | drag.filterChildren: true | | |||
74 | onPressed: uiVisible = true; | | |||
75 | onPositionChanged: uiVisible = true; | | |||
76 | onUiVisibleChanged: { | | |||
77 | if (blockUI) { | | |||
78 | fadeoutTimer.running = false; | | |||
79 | } else if (uiVisible) { | | |||
80 | fadeoutTimer.restart(); | | |||
81 | } | | |||
82 | } | | |||
83 | onBlockUIChanged: { | | |||
84 | if (blockUI) { | | |||
85 | fadeoutTimer.running = false; | | |||
86 | uiVisible = true; | | |||
87 | } else { | | |||
88 | fadeoutTimer.restart(); | | |||
89 | } | | |||
90 | } | | |||
91 | | ||||
92 | //takes one full minute for the ui to disappear | | |||
93 | Timer { | | |||
94 | id: fadeoutTimer | | |||
95 | running: true | | |||
96 | interval: 60000 | | |||
97 | onTriggered: { | | |||
98 | if (!loginScreenRoot.blockUI) { | | |||
99 | loginScreenRoot.uiVisible = false; | | |||
100 | } | | |||
101 | } | | |||
102 | } | | |||
103 | WallpaperFader { | | |||
104 | visible: config.type == "image" | | |||
105 | anchors.fill: parent | | |||
106 | state: loginScreenRoot.uiVisible ? "on" : "off" | | |||
107 | source: wallpaper | | |||
108 | mainStack: mainStack | | |||
109 | footer: footer | | |||
110 | clock: clock | | |||
111 | } | | |||
112 | | ||||
113 | DropShadow { | 65 | DropShadow { | ||
114 | id: clockShadow | 66 | id: clockShadow | ||
115 | anchors.fill: clock | 67 | anchors.fill: clock | ||
116 | source: clock | 68 | source: clock | ||
117 | horizontalOffset: 0 | 69 | horizontalOffset: 0 | ||
118 | verticalOffset: 1 | 70 | verticalOffset: 1 | ||
119 | radius: 12 | 71 | radius: 12 | ||
120 | samples: 32 | 72 | samples: 32 | ||
121 | spread: 0.2 | 73 | spread: 0.25 | ||
122 | color: Qt.rgba(0, 0, 0, 1) | 74 | color: PlasmaCore.ColorScope.windowColor | ||
123 | Behavior on opacity { | | |||
124 | OpacityAnimator { | | |||
125 | duration: 1000 | | |||
126 | easing.type: Easing.InOutQuad | | |||
127 | } | | |||
128 | } | | |||
129 | } | 75 | } | ||
130 | 76 | | |||
131 | Clock { | 77 | Clock { | ||
132 | id: clock | 78 | id: clock | ||
133 | visible: y > 0 | 79 | visible: y > 0 | ||
134 | property Item shadow: clockShadow | 80 | property Item shadow: clockShadow | ||
135 | y: (userListComponent.userList.y + mainStack.y)/2 - height/2 | 81 | y: (userListComponent.userList.y + mainStack.y)/2 - height/2 | ||
136 | anchors.horizontalCenter: parent.horizontalCenter | 82 | anchors.horizontalCenter: parent.horizontalCenter | ||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Line(s) | 124 | if (keystateSource.data["Caps Lock"]["Locked"]) { | |||
182 | } | 128 | } | ||
183 | } | 129 | } | ||
184 | text += root.notificationMessage | 130 | text += root.notificationMessage | ||
185 | return text | 131 | return text | ||
186 | } | 132 | } | ||
187 | 133 | | |||
188 | actionItems: [ | 134 | actionItems: [ | ||
189 | ActionButton { | 135 | ActionButton { | ||
190 | iconSource: "system-suspend" | 136 | iconSource: "system-suspend-translucent" | ||
191 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Suspend") | 137 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Suspend") | ||
138 | labelShadow: true | ||||
192 | onClicked: sddm.suspend() | 139 | onClicked: sddm.suspend() | ||
193 | enabled: sddm.canSuspend | 140 | enabled: sddm.canSuspend | ||
194 | visible: !inputPanel.keyboardActive | 141 | visible: !inputPanel.keyboardActive | ||
195 | }, | 142 | }, | ||
196 | ActionButton { | 143 | ActionButton { | ||
197 | iconSource: "system-reboot" | 144 | iconSource: "system-reboot-translucent" | ||
198 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Restart") | 145 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Restart") | ||
146 | labelShadow: true | ||||
199 | onClicked: sddm.reboot() | 147 | onClicked: sddm.reboot() | ||
200 | enabled: sddm.canReboot | 148 | enabled: sddm.canReboot | ||
201 | visible: !inputPanel.keyboardActive | 149 | visible: !inputPanel.keyboardActive | ||
202 | }, | 150 | }, | ||
203 | ActionButton { | 151 | ActionButton { | ||
204 | iconSource: "system-shutdown" | 152 | iconSource: "system-shutdown-translucent" | ||
205 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Shut Down") | 153 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Shut Down") | ||
154 | labelShadow: true | ||||
206 | onClicked: sddm.powerOff() | 155 | onClicked: sddm.powerOff() | ||
207 | enabled: sddm.canPowerOff | 156 | enabled: sddm.canPowerOff | ||
208 | visible: !inputPanel.keyboardActive | 157 | visible: !inputPanel.keyboardActive | ||
209 | }, | 158 | }, | ||
210 | ActionButton { | 159 | ActionButton { | ||
211 | iconSource: "system-switch-user" | 160 | iconSource: "system-switch-user-translucent" | ||
212 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Different User") | 161 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Different User") | ||
162 | labelShadow: true | ||||
213 | onClicked: mainStack.push(userPromptComponent) | 163 | onClicked: mainStack.push(userPromptComponent) | ||
214 | enabled: true | 164 | enabled: true | ||
215 | visible: !userListComponent.showUsernamePrompt && !inputPanel.keyboardActive | 165 | visible: !userListComponent.showUsernamePrompt && !inputPanel.keyboardActive | ||
216 | }] | 166 | }] | ||
217 | 167 | | |||
218 | onLoginRequest: { | 168 | onLoginRequest: { | ||
219 | root.notificationMessage = "" | 169 | root.notificationMessage = "" | ||
220 | sddm.login(username, password, sessionButton.currentIndex) | 170 | sddm.login(username, password, sessionButton.currentIndex) | ||
221 | } | 171 | } | ||
222 | } | 172 | } | ||
223 | | ||||
224 | Behavior on opacity { | | |||
225 | OpacityAnimator { | | |||
226 | duration: units.longDuration | | |||
227 | } | | |||
228 | } | | |||
229 | } | 173 | } | ||
230 | 174 | | |||
231 | Loader { | 175 | Loader { | ||
232 | id: inputPanel | 176 | id: inputPanel | ||
233 | state: "hidden" | 177 | state: "hidden" | ||
234 | property bool keyboardActive: item ? item.active : false | 178 | property bool keyboardActive: item ? item.active : false | ||
235 | onKeyboardActiveChanged: { | 179 | onKeyboardActiveChanged: { | ||
236 | if (keyboardActive) { | 180 | if (keyboardActive) { | ||
▲ Show 20 Lines • Show All 98 Lines • ▼ Show 20 Line(s) | 278 | script: { | |||
335 | Qt.inputMethod.hide(); | 279 | Qt.inputMethod.hide(); | ||
336 | } | 280 | } | ||
337 | } | 281 | } | ||
338 | } | 282 | } | ||
339 | } | 283 | } | ||
340 | ] | 284 | ] | ||
341 | } | 285 | } | ||
342 | 286 | | |||
343 | | ||||
344 | Component { | 287 | Component { | ||
345 | id: userPromptComponent | 288 | id: userPromptComponent | ||
346 | Login { | 289 | Login { | ||
347 | showUsernamePrompt: true | 290 | showUsernamePrompt: true | ||
348 | notificationMessage: root.notificationMessage | 291 | notificationMessage: root.notificationMessage | ||
349 | 292 | | |||
350 | userListModel: QtObject { | 293 | userListModel: QtObject { | ||
351 | property string name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Log in as a different user") | 294 | property string name: i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Log in as a different user") | ||
352 | property string iconSource: "" | 295 | property string iconSource: "" | ||
353 | } | 296 | } | ||
354 | 297 | | |||
355 | onLoginRequest: { | 298 | onLoginRequest: { | ||
356 | root.notificationMessage = "" | 299 | root.notificationMessage = "" | ||
357 | sddm.login(username, password, sessionButton.currentIndex) | 300 | sddm.login(username, password, sessionButton.currentIndex) | ||
358 | } | 301 | } | ||
davidedmundson: This is now choosing an arbitrary size and hoping the contents happen to be smaller. | |||||
359 | 302 | | |||
360 | actionItems: [ | 303 | actionItems: [ | ||
361 | ActionButton { | 304 | ActionButton { | ||
362 | iconSource: "go-previous" | 305 | iconSource: "go-previous-translucent" | ||
363 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Back") | 306 | text: i18nd("plasma_lookandfeel_org.kde.lookandfeel","Back") | ||
364 | onClicked: mainStack.pop() | 307 | onClicked: mainStack.pop() | ||
308 | labelShadow: true | ||||
365 | } | 309 | } | ||
366 | ] | 310 | ] | ||
367 | } | 311 | } | ||
368 | } | 312 | } | ||
369 | 313 | | |||
370 | //Footer | 314 | //Footer | ||
371 | RowLayout { | 315 | RowLayout { | ||
372 | id: footer | 316 | id: footer | ||
Show All 25 Lines | |||||
398 | } | 342 | } | ||
399 | 343 | | |||
400 | Item { | 344 | Item { | ||
401 | Layout.fillWidth: true | 345 | Layout.fillWidth: true | ||
402 | } | 346 | } | ||
403 | 347 | | |||
404 | Battery { } | 348 | Battery { } | ||
405 | } | 349 | } | ||
406 | } | | |||
407 | 350 | | |||
408 | Connections { | 351 | Connections { | ||
409 | target: sddm | 352 | target: sddm | ||
410 | onLoginFailed: { | 353 | onLoginFailed: { | ||
411 | notificationMessage = i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Login Failed") | 354 | notificationMessage = i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Login Failed") | ||
412 | } | 355 | } | ||
413 | onLoginSucceeded: { | 356 | onLoginSucceeded: { | ||
414 | //note SDDM will kill the greeter at some random point after this | 357 | //note SDDM will kill the greeter at some random point after this | ||
Show All 19 Lines |
This is now choosing an arbitrary size and hoping the contents happen to be smaller.
Generally (if possible) you want views to fit contents, not squish contents to view.
i.e
height: theInnerLayout.implicitHeight