on xenial help sign in
Don't show background on lock screen; show greeter when powerd is pressed
87e5093Michael Terry
Greeter/Greeter.qml+9
@@ -26,6 +26,8 @@ Showable {
26 enabled: shown
26 enabled: shown
27 created: greeterContentLoader.status == Loader.Ready
27 created: greeterContentLoader.status == Loader.Ready
28
28
29+ property url background
30+
29 // 1 when fully shown and 0 when fully hidden
31 // 1 when fully shown and 0 when fully hidden
30 property real showProgress: MathLocal.clamp((width + x) / width, 0, 1)
32 property real showProgress: MathLocal.clamp((width + x) / width, 0, 1)
31
33
@@ -55,6 +57,13 @@ Showable {
55 }
57 }
56 }
58 }
57
59
60+ CrossFadeImage {
61+ id: backgroundImage
62+ anchors.fill: parent
63+ fadeInFirst: false
64+ source: greeter.background
65+ }
66+
58 Loader {
67 Loader {
59 id: greeterContentLoader
68 id: greeterContentLoader
60 objectName: "greeterContentLoader"
69 objectName: "greeterContentLoader"
GreeterShell.qml+22−12
@@ -14,16 +14,18 @@
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
15 */
16
16
17−import QtQuick 2.0
18−import Ubuntu.Application 0.1
19import AccountsService 0.1
17import AccountsService 0.1
20import LightDM 0.1 as LightDM
18import LightDM 0.1 as LightDM
19+import Powerd 0.1
20+import QtQuick 2.0
21import SessionBroadcast 0.1
21import SessionBroadcast 0.1
22+import Ubuntu.Application 0.1
23+import Unity.Launcher 0.1
24+import "Components"
25+import "Components/Math.js" as MathLocal
22import "Greeter"
26import "Greeter"
23import "Launcher"
27import "Launcher"
24import "Panel"
28import "Panel"
25−import "Components"
26−import "Components/Math.js" as MathLocal
27
29
28BasicShell {
30BasicShell {
29 id: shell
31 id: shell
@@ -35,13 +37,6 @@ BasicShell {
35
37
36 backgroundSource: AccountsService.backgroundFile
38 backgroundSource: AccountsService.backgroundFile
37
39
38− CrossFadeImage {
39− id: backgroundImage
40− anchors.fill: parent
41− fadeInFirst: false
42− source: shell.background
43− }
44−
45 Lockscreen {
40 Lockscreen {
46 id: lockscreen
41 id: lockscreen
47 hides: [launcher, panel.indicators]
42 hides: [launcher, panel.indicators]
@@ -53,7 +48,6 @@ BasicShell {
53 x: required ? 0 : - width
48 x: required ? 0 : - width
54 width: parent.width
49 width: parent.width
55 height: parent.height - panel.panelHeight
50 height: parent.height - panel.panelHeight
56− background: shell.background
57
51
58 onUnlocked: lockscreen.hide()
52 onUnlocked: lockscreen.hide()
59 onCancel: greeter.show()
53 onCancel: greeter.show()
@@ -90,6 +84,7 @@ BasicShell {
90 available: true
84 available: true
91 hides: [launcher, panel.indicators]
85 hides: [launcher, panel.indicators]
92 shown: true
86 shown: true
87+ background: shell.background
93
88
94 y: panel.panelHeight
89 y: panel.panelHeight
95 width: parent.width
90 width: parent.width
@@ -183,6 +178,21 @@ BasicShell {
183 panel.indicators.hide()
178 panel.indicators.hide()
184 }
179 }
185 }
180 }
181+ onDashItemSelected: greeter.show()
182+ }
183+ }
184+
185+ Connections {
186+ id: powerConnection
187+ target: Powerd
188+
189+ onDisplayPowerStateChange: {
190+ if (status == Powerd.Off) {
191+ greeter.show();
192+ edgeDemo.paused = true;
193+ } else if (status == Powerd.On) {
194+ edgeDemo.paused = false;
195+ }
186 }
196 }
187 }
197 }
188
198