on xenial help sign in
unitfy Greeter and Lockscreen wallpapers again
5bd3dbcMichael Zanetti
qml/Components/Lockscreen.qml+9
@@ -100,10 +100,19 @@ Showable {
100 anchors {
100 anchors {
101 fill: parent
101 fill: parent
102 }
102 }
103+ // Limit how much memory we'll reserve for this image
104+ sourceSize.height: height
105+ sourceSize.width: width
103 source: root.required ? root.background : ""
106 source: root.required ? root.background : ""
104 fillMode: Image.PreserveAspectCrop
107 fillMode: Image.PreserveAspectCrop
105 }
108 }
106
109
110+ Rectangle {
111+ anchors.fill: parent
112+ color: "black"
113+ opacity: 0.4
114+ }
115+
107 MouseArea {
116 MouseArea {
108 anchors.fill: root
117 anchors.fill: root
109 onClicked: {
118 onClicked: {
qml/Greeter/Greeter.qml+1−1
@@ -25,7 +25,7 @@ Showable {
25 enabled: shown
25 enabled: shown
26 created: greeterContentLoader.status == Loader.Ready && greeterContentLoader.item.ready
26 created: greeterContentLoader.status == Loader.Ready && greeterContentLoader.item.ready
27
27
28− property url defaultBackground
28+ property url background
29 property bool loadContent: required
29 property bool loadContent: required
30
30
31 // 1 when fully shown and 0 when fully hidden
31 // 1 when fully shown and 0 when fully hidden
qml/Greeter/GreeterContent.qml+1−18
@@ -48,9 +48,6 @@ Item {
48 color: "black"
48 color: "black"
49 }
49 }
50
50
51− property url backgroundValue: AccountsService.backgroundFile != undefined && AccountsService.backgroundFile.length > 0 ? AccountsService.backgroundFile : greeter.defaultBackground
52− onBackgroundValueChanged: background.source = backgroundValue
53−
54 CrossFadeImage {
51 CrossFadeImage {
55 id: background
52 id: background
56 objectName: "greeterBackground"
53 objectName: "greeterBackground"
@@ -62,21 +59,7 @@ Item {
62 // Limit how much memory we'll reserve for this image
59 // Limit how much memory we'll reserve for this image
63 sourceSize.height: height
60 sourceSize.height: height
64 sourceSize.width: width
61 sourceSize.width: width
65− }
62+ source: greeter.background
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− }
80 }
63 }
81
64
82 Rectangle {
65 Rectangle {
qml/Shell.qml+17−11
@@ -51,7 +51,7 @@ Item {
51
51
52 property real edgeSize: units.gu(2)
52 property real edgeSize: units.gu(2)
53 property url defaultBackground: Qt.resolvedUrl(shell.width >= units.gu(60) ? "graphics/tablet_background.jpg" : "graphics/phone_background.jpg")
53 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
55 readonly property real panelHeight: panel.panelHeight
55 readonly property real panelHeight: panel.panelHeight
56
56
57 readonly property bool locked: LightDM.Greeter.active && !LightDM.Greeter.authenticated && !forcedUnlock
57 readonly property bool locked: LightDM.Greeter.active && !LightDM.Greeter.authenticated && !forcedUnlock
@@ -99,6 +99,21 @@ Item {
99 shell.activateApplication(app)
99 shell.activateApplication(app)
100 }
100 }
101
101
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+
102 Binding {
117 Binding {
103 target: LauncherModel
118 target: LauncherModel
104 property: "applicationManager"
119 property: "applicationManager"
@@ -115,15 +130,6 @@ Item {
115 }
130 }
116 }
131 }
117
132
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−
127 VolumeControl {
133 VolumeControl {
128 id: volumeControl
134 id: volumeControl
129 }
135 }
@@ -524,7 +530,7 @@ Item {
524
530
525 locked: shell.locked
531 locked: shell.locked
526
532
527− defaultBackground: shell.background
533+ background: shell.background
528
534
529 width: parent.width
535 width: parent.width
530 height: parent.height
536 height: parent.height