@@ -14,7 +14,6 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import GSettings 1.0
1817import QtQuick 2.0
1918import Ubuntu.Components 0.1
2019import "../Components"
@@ -29,17 +28,12 @@ FocusScope {
2928 height: tablet ? units.gu(100) : applicationArguments.hasGeometry() ? applicationArguments.height() : units.gu(71)
3029
3130 property real edgeSize: units.gu(2)
31+
3232 property url defaultBackground: shell.width >= units.gu(60) ? "../graphics/tablet_background.jpg" : "../graphics/phone_background.jpg"
3333 property url background
34−
35− GSettings {
36− id: backgroundSettings
37− schema.id: "org.gnome.desktop.background"
38− }
39− property url gSettingsPicture: backgroundSettings.pictureUri != undefined && backgroundSettings.pictureUri.length > 0 ? backgroundSettings.pictureUri : shell.defaultBackground
40− onGSettingsPictureChanged: {
41− shell.background = gSettingsPicture
42− }
34+ property url backgroundSource
35+ property url backgroundFinal: backgroundSource != undefined && backgroundSource != "" ? backgroundSource : shell.defaultBackground
36+ onBackgroundFinalChanged: shell.background = backgroundFinal
4337
4438 // This is a dummy image that is needed to determine if the picture url
4539 // in backgroundSettings points to a valid picture file.
@@ -56,8 +50,13 @@ FocusScope {
5650 sourceSize.height: 0
5751 sourceSize.width: 0
5852 onStatusChanged: {
59− if (status == Image.Error && source != shell.defaultBackground) {
60− shell.background = defaultBackground
53+ if (status == Image.Error) {
54+ if (source != shell.defaultBackground) {
55+ shell.background = defaultBackground
56+ } else {
57+ // In case even our default background fails to load...
58+ shell.background = "data:image/svg+xml,<svg><rect width='100%' height='100%' fill='#000'/></svg>"
59+ }
6160 }
6261 }
6362 }