@@ -41,8 +41,8 @@ FocusScope {
41 height: tablet ? units.gu(100) : units.gu(71)
41 height: tablet ? units.gu(100) : units.gu(71)
43 property real edgeSize: units.gu(2)
43 property real edgeSize: units.gu(2)
44− property url default_background: shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg"
44+ property url defaultBackground: shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg"
45− property url background: default_background
45+ property url background: backgroundSettings.pictureUri
46 readonly property real panelHeight: panel.panelHeight
46 readonly property real panelHeight: panel.panelHeight
48 property bool dashShown: dash.shown
48 property bool dashShown: dash.shown
@@ -118,40 +118,6 @@ FocusScope {
118 schema.id: "org.gnome.desktop.background"
118 schema.id: "org.gnome.desktop.background"
121− function updateImage() {
122− if (testImage.source == "")
125− if (testImage.status == Image.Ready) {
126− if (shell.width / shell.height <= testImage.sourceSize.width / testImage.sourceSize.height) {
127− backgroundImage.sourceSize.width = 0
128− backgroundImage.sourceSize.height = Qt.binding(function() { return shell.height })
130− backgroundImage.sourceSize.height = 0
131− backgroundImage.sourceSize.width = Qt.binding(function() { return shell.width })
134− shell.background = testImage.source
135− } else if (testImage.status == Image.Error) {
136− shell.background = shell.default_background
139− // unload testImage source to save memory
140− testImage.source = ""
146− property url gsettingsImage: backgroundSettings.pictureUri
148− source: gsettingsImage
151− onGsettingsImageChanged: source = gsettingsImage
152− onStatusChanged: updateImage()
155 VolumeControl {
121 VolumeControl {
156 id: volumeControl
122 id: volumeControl
@@ -173,11 +139,15 @@ FocusScope {
173 || (stages.fullyShown && mainStage.usingScreenshots)
139 || (stages.fullyShown && mainStage.usingScreenshots)
174 || !stages.fullyShown && (mainStage.usingScreenshots || (sideStage.shown && sideStage.usingScreenshots)))
140 || !stages.fullyShown && (mainStage.usingScreenshots || (sideStage.shown && sideStage.usingScreenshots)))
176− Image {
142+ CrossFadeImage {
177 id: backgroundImage
143 id: backgroundImage
178 source: shell.background
144 source: shell.background
179 anchors.fill: parent
145 anchors.fill: parent
180− fillMode: Image.PreserveAspectCrop
146+ onStatusChanged: {
147+ if (status == Image.Error) {
148+ backgroundSettings.pictureUri = shell.defaultBackground
183 Rectangle {
153 Rectangle {
@@ -476,7 +446,7 @@ FocusScope {
476 onUnlocked: greeter.hide()
446 onUnlocked: greeter.hide()
477 onSelected: {
447 onSelected: {
478 var bgPath = greeter.model.data(uid, LightDM.UserRoles.BackgroundPathRole)
448 var bgPath = greeter.model.data(uid, LightDM.UserRoles.BackgroundPathRole)
479− shell.background = bgPath ? bgPath : default_background
449+ shell.background = bgPath ? bgPath : defaultBackground
482 onLeftTeaserPressedChanged: {
452 onLeftTeaserPressedChanged: {