on xenial help sign in
Have the greeter listen to AccountsService for its background file
f26ddf0Michael Terry
Greeter/GreeterContent.qml+19−2
@@ -15,6 +15,7 @@
15 */
15 */
16
16
17import QtQuick 2.0
17import QtQuick 2.0
18+import AccountsService 0.1
18import Ubuntu.Components 0.1
19import Ubuntu.Components 0.1
19import LightDM 0.1 as LightDM
20import LightDM 0.1 as LightDM
20import "../Components"
21import "../Components"
@@ -39,14 +40,30 @@ MouseArea {
39 color: "black"
40 color: "black"
40 }
41 }
41
42
43+ property url backgroundValue: AccountsService.backgroundFile != undefined && AccountsService.backgroundFile.length > 0 ? AccountsService.backgroundFile : shell.defaultBackground
44+ onBackgroundValueChanged: wallpaper.source = backgroundValue
45+
42 CrossFadeImage {
46 CrossFadeImage {
43 id: wallpaper
47 id: wallpaper
44−
45− source: shell.background
46 anchors.fill: parent
48 anchors.fill: parent
47 fadeInFirst: false
49 fadeInFirst: false
48 }
50 }
49
51
52+ // See Shell.qml's backgroundSettings treatment for why we need a separate
53+ // Image, but it boils down to avoiding binding loop detection.
54+ Image {
55+ source: wallpaper.source
56+ height: 0
57+ width: 0
58+ sourceSize.height: 0
59+ sourceSize.width: 0
60+ onStatusChanged: {
61+ if (status == Image.Error && source != shell.defaultBackground) {
62+ wallpaper.source = shell.defaultBackground
63+ }
64+ }
65+ }
66+
50 Rectangle {
67 Rectangle {
51 anchors.fill: parent
68 anchors.fill: parent
52 color: "black"
69 color: "black"