on xenial help sign in
Don't show background on lock screen; show greeter when powerd is pressed
commit87e5093adb1a76f3ad6c671eb895404ac96dc9fe authorMichael Terry <michael.terry@canonical.com> dateFri 6 Sep 2013, 16:01 (13 years ago) parent3609dc0
2 files changed+31−12
Greeter/Greeter.qml+9 GreeterShell.qml+22−12
Greeter/Greeter.qml+9
@@ -26,6 +26,8 @@ Showable {
2626 enabled: shown
2727 created: greeterContentLoader.status == Loader.Ready
2828
29+ property url background
30+
2931 // 1 when fully shown and 0 when fully hidden
3032 property real showProgress: MathLocal.clamp((width + x) / width, 0, 1)
3133
@@ -55,6 +57,13 @@ Showable {
5557 }
5658 }
5759
60+ CrossFadeImage {
61+ id: backgroundImage
62+ anchors.fill: parent
63+ fadeInFirst: false
64+ source: greeter.background
65+ }
66+
5867 Loader {
5968 id: greeterContentLoader
6069 objectName: "greeterContentLoader"
GreeterShell.qml+22−12
@@ -14,16 +14,18 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Application 0.1
1917import AccountsService 0.1
2018import LightDM 0.1 as LightDM
19+import Powerd 0.1
20+import QtQuick 2.0
2121import 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
2226import "Greeter"
2327import "Launcher"
2428import "Panel"
25−import "Components"
26−import "Components/Math.js" as MathLocal
2729
2830BasicShell {
2931 id: shell
@@ -35,13 +37,6 @@ BasicShell {
3537
3638 backgroundSource: AccountsService.backgroundFile
3739
38− CrossFadeImage {
39− id: backgroundImage
40− anchors.fill: parent
41− fadeInFirst: false
42− source: shell.background
43− }
44−
4540 Lockscreen {
4641 id: lockscreen
4742 hides: [launcher, panel.indicators]
@@ -53,7 +48,6 @@ BasicShell {
5348 x: required ? 0 : - width
5449 width: parent.width
5550 height: parent.height - panel.panelHeight
56− background: shell.background
5751
5852 onUnlocked: lockscreen.hide()
5953 onCancel: greeter.show()
@@ -90,6 +84,7 @@ BasicShell {
9084 available: true
9185 hides: [launcher, panel.indicators]
9286 shown: true
87+ background: shell.background
9388
9489 y: panel.panelHeight
9590 width: parent.width
@@ -183,6 +178,21 @@ BasicShell {
183178 panel.indicators.hide()
184179 }
185180 }
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+ }
186196 }
187197 }
188198