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.2 | ||
122 | color: Qt.rgba(0, 0, 0, 1) | 74 | color: Qt.rgba(0, 0, 0, 1) | ||
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 | } | ||
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 | Rectangle { | ||
372 | id: footer | 316 | id: footer | ||
373 | anchors { | 317 | anchors { | ||
374 | bottom: parent.bottom | 318 | bottom: parent.bottom | ||
375 | left: parent.left | 319 | left: parent.left | ||
376 | right: parent.right | 320 | right: parent.right | ||
377 | margins: units.smallSpacing | | |||
378 | } | 321 | } | ||
322 | height: units.gridUnit * 2 | ||||
davidedmundson: This is now choosing an arbitrary size and hoping the contents happen to be smaller. | |||||
323 | | ||||
324 | color: "#232629" // Breeze Shade Black | ||||
325 | opacity: 0.9 | ||||
379 | 326 | | |||
380 | Behavior on opacity { | 327 | Behavior on opacity { | ||
381 | OpacityAnimator { | 328 | OpacityAnimator { | ||
382 | duration: units.longDuration | 329 | duration: units.longDuration | ||
383 | } | 330 | } | ||
384 | } | 331 | } | ||
385 | 332 | | |||
333 | RowLayout { | ||||
334 | anchors { | ||||
335 | fill: parent | ||||
336 | margins: units.smallSpacing | ||||
337 | } | ||||
338 | | ||||
386 | PlasmaComponents.ToolButton { | 339 | PlasmaComponents.ToolButton { | ||
387 | text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "Button to show/hide virtual keyboard", "Virtual Keyboard") | 340 | text: i18ndc("plasma_lookandfeel_org.kde.lookandfeel", "Button to show/hide virtual keyboard", "Virtual Keyboard") | ||
388 | iconName: inputPanel.keyboardActive ? "input-keyboard-virtual-on" : "input-keyboard-virtual-off" | 341 | iconName: inputPanel.keyboardActive ? "input-keyboard-virtual-on" : "input-keyboard-virtual-off" | ||
389 | onClicked: inputPanel.showHide() | 342 | onClicked: inputPanel.showHide() | ||
390 | visible: inputPanel.status == Loader.Ready | 343 | visible: inputPanel.status == Loader.Ready | ||
391 | } | 344 | } | ||
392 | 345 | | |||
393 | KeyboardButton { | 346 | KeyboardButton { | ||
Show All 40 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