on xenial help sign in
unitfy Greeter and Lockscreen wallpapers again
commit5bd3dbc8e05cf32e0541dfdd6a2f00bd36b02e20 authorMichael Zanetti <michael.zanetti@canonical.com> dateFri 7 Nov 2014, 12:54 (12 years ago) parent1a13033
4 files changed+28−30
qml/Components/Lockscreen.qml+9 qml/Greeter/Greeter.qml+1−1 qml/Greeter/GreeterContent.qml+1−18 qml/Shell.qml+17−11
qml/Components/Lockscreen.qml+9
@@ -100,10 +100,19 @@ Showable {
100100 anchors {
101101 fill: parent
102102 }
103+ // Limit how much memory we'll reserve for this image
104+ sourceSize.height: height
105+ sourceSize.width: width
103106 source: root.required ? root.background : ""
104107 fillMode: Image.PreserveAspectCrop
105108 }
106109
110+ Rectangle {
111+ anchors.fill: parent
112+ color: "black"
113+ opacity: 0.4
114+ }
115+
107116 MouseArea {
108117 anchors.fill: root
109118 onClicked: {
qml/Greeter/Greeter.qml+1−1
@@ -25,7 +25,7 @@ Showable {
2525 enabled: shown
2626 created: greeterContentLoader.status == Loader.Ready && greeterContentLoader.item.ready
2727
28− property url defaultBackground
28+ property url background
2929 property bool loadContent: required
3030
3131 // 1 when fully shown and 0 when fully hidden
qml/Greeter/GreeterContent.qml+1−18
@@ -48,9 +48,6 @@ Item {
4848 color: "black"
4949 }
5050
51− property url backgroundValue: AccountsService.backgroundFile != undefined && AccountsService.backgroundFile.length > 0 ? AccountsService.backgroundFile : greeter.defaultBackground
52− onBackgroundValueChanged: background.source = backgroundValue
53−
5451 CrossFadeImage {
5552 id: background
5653 objectName: "greeterBackground"
@@ -62,21 +59,7 @@ Item {
6259 // Limit how much memory we'll reserve for this image
6360 sourceSize.height: height
6461 sourceSize.width: width
65− }
66−
67− // See Shell.qml's backgroundSettings treatment for why we need a separate
68− // Image, but it boils down to avoiding binding loop detection.
69− Image {
70− source: background.source
71− height: 0
72− width: 0
73− sourceSize.height: 0
74− sourceSize.width: 0
75− onStatusChanged: {
76− if (status == Image.Error && source != greeter.defaultBackground) {
77− background.source = greeter.defaultBackground
78− }
79− }
62+ source: greeter.background
8063 }
8164
8265 Rectangle {
qml/Shell.qml+17−11
@@ -51,7 +51,7 @@ Item {
5151
5252 property real edgeSize: units.gu(2)
5353 property url defaultBackground: Qt.resolvedUrl(shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg")
54− property url background
54+ property url background: AccountsService.backgroundFile != undefined && AccountsService.backgroundFile.length > 0 ? AccountsService.backgroundFile : defaultBackground
5555 readonly property real panelHeight: panel.panelHeight
5656
5757 readonly property bool locked: LightDM.Greeter.active && !LightDM.Greeter.authenticated && !forcedUnlock
@@ -99,6 +99,21 @@ Item {
9999 shell.activateApplication(app)
100100 }
101101
102+ // This is a dummy image to detect if the custom set wallpaper
103+ // loads successfully. If it doesn't fall back to the defaultBackground.
104+ Image {
105+ source: shell.background
106+ height: 0
107+ width: 0
108+ sourceSize.height: 0
109+ sourceSize.width: 0
110+ onStatusChanged: {
111+ if (status == Image.Error && source != shell.defaultBackground) {
112+ shell.background = shell.defaultBackground
113+ }
114+ }
115+ }
116+
102117 Binding {
103118 target: LauncherModel
104119 property: "applicationManager"
@@ -115,15 +130,6 @@ Item {
115130 }
116131 }
117132
118− GSettings {
119− id: backgroundSettings
120− schema.id: "org.gnome.desktop.background"
121− }
122− property url gSettingsPicture: backgroundSettings.pictureUri != undefined && backgroundSettings.pictureUri.length > 0 ? backgroundSettings.pictureUri : shell.defaultBackground
123− onGSettingsPictureChanged: {
124− shell.background = gSettingsPicture
125− }
126−
127133 VolumeControl {
128134 id: volumeControl
129135 }
@@ -524,7 +530,7 @@ Item {
524530
525531 locked: shell.locked
526532
527− defaultBackground: shell.background
533+ background: shell.background
528534
529535 width: parent.width
530536 height: parent.height