on xenial help sign in
unify Greeter and Lockscreen wallpaper again
a72d409Michael Zanetti
qml/Components/Lockscreen.qml+15
@@ -56,6 +56,9 @@ Showable {
56 property int maxPinLength: -1
56 property int maxPinLength: -1
57
57
58 property url background: ""
58 property url background: ""
59+ // Use this to put a black overlay above the background
60+ // 0: normal background, 1: black background
61+ property real darkenBackground: 0
59
62
60 readonly property string passphrase: (pinPadLoader.item && pinPadLoader.item.passphrase) ? pinPadLoader.item.passphrase : ""
63 readonly property string passphrase: (pinPadLoader.item && pinPadLoader.item.passphrase) ? pinPadLoader.item.passphrase : ""
61
64
@@ -100,10 +103,22 @@ Showable {
100 anchors {
103 anchors {
101 fill: parent
104 fill: parent
102 }
105 }
106+ // Limit how much memory we'll reserve for this image
107+ sourceSize.height: height
108+ sourceSize.width: width
103 source: root.required ? root.background : ""
109 source: root.required ? root.background : ""
104 fillMode: Image.PreserveAspectCrop
110 fillMode: Image.PreserveAspectCrop
105 }
111 }
106
112
113+ // This is to
114+ // a) align it with the greeter and
115+ // b) keep the white fonts readable on bright backgrounds
116+ Rectangle {
117+ anchors.fill: parent
118+ color: "black"
119+ opacity: root.darkenBackground
120+ }
121+
107 MouseArea {
122 MouseArea {
108 anchors.fill: root
123 anchors.fill: root
109 onClicked: {
124 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/Notifications/NotificationMenuItemFactory.qml+1
@@ -150,6 +150,7 @@ Loader {
150 errorText: errorAction.valid ? errorAction.state : ""
150 errorText: errorAction.valid ? errorAction.state : ""
151 retryText: notification.body
151 retryText: notification.body
152 background: shell.background
152 background: shell.background
153+ darkenBackground: 0.4
153
154
154 onEntered: {
155 onEntered: {
155 menuModel.changeState(menuIndex, passphrase);
156 menuModel.changeState(menuIndex, passphrase);
qml/Shell.qml+29−11
@@ -51,7 +51,8 @@ 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: asImageTester.status == Image.Ready ? asImageTester.source
55+ : gsImageTester.status == Image.Ready ? gsImageTester.source : defaultBackground
55 readonly property real panelHeight: panel.panelHeight
56 readonly property real panelHeight: panel.panelHeight
56
57
57 readonly property bool locked: LightDM.Greeter.active && !LightDM.Greeter.authenticated && !forcedUnlock
58 readonly property bool locked: LightDM.Greeter.active && !LightDM.Greeter.authenticated && !forcedUnlock
@@ -98,6 +99,31 @@ Item {
98 shell.activateApplication(app);
99 shell.activateApplication(app);
99 }
100 }
100
101
102+ // This is a dummy image to detect if the custom AS set wallpaper loads successfully.
103+ Image {
104+ id: asImageTester
105+ source: AccountsService.backgroundFile != undefined && AccountsService.backgroundFile.length > 0 ? AccountsService.backgroundFile : ""
106+ height: 0
107+ width: 0
108+ sourceSize.height: 0
109+ sourceSize.width: 0
110+ }
111+
112+ GSettings {
113+ id: backgroundSettings
114+ schema.id: "org.gnome.desktop.background"
115+ }
116+
117+ // This is a dummy image to detect if the custom GSettings set wallpaper loads successfully.
118+ Image {
119+ id: gsImageTester
120+ source: backgroundSettings.pictureUri != undefined && backgroundSettings.pictureUri.length > 0 ? backgroundSettings.pictureUri : ""
121+ height: 0
122+ width: 0
123+ sourceSize.height: 0
124+ sourceSize.width: 0
125+ }
126+
101 Binding {
127 Binding {
102 target: LauncherModel
128 target: LauncherModel
103 property: "applicationManager"
129 property: "applicationManager"
@@ -114,15 +140,6 @@ Item {
114 }
140 }
115 }
141 }
116
142
117− GSettings {
118− id: backgroundSettings
119− schema.id: "org.gnome.desktop.background"
120− }
121− property url gSettingsPicture: backgroundSettings.pictureUri != undefined && backgroundSettings.pictureUri.length > 0 ? backgroundSettings.pictureUri : shell.defaultBackground
122− onGSettingsPictureChanged: {
123− shell.background = gSettingsPicture
124− }
125−
126 VolumeControl {
143 VolumeControl {
127 id: volumeControl
144 id: volumeControl
128 }
145 }
@@ -328,6 +345,7 @@ Item {
328 width: parent.width
345 width: parent.width
329 height: parent.height - panel.panelHeight
346 height: parent.height - panel.panelHeight
330 background: shell.background
347 background: shell.background
348+ darkenBackground: 0.4
331 alphaNumeric: AccountsService.passwordDisplayHint === AccountsService.Keyboard
349 alphaNumeric: AccountsService.passwordDisplayHint === AccountsService.Keyboard
332 minPinLength: 4
350 minPinLength: 4
333 maxPinLength: 4
351 maxPinLength: 4
@@ -523,7 +541,7 @@ Item {
523
541
524 locked: shell.locked
542 locked: shell.locked
525
543
526− defaultBackground: shell.background
544+ background: shell.background
527
545
528 width: parent.width
546 width: parent.width
529 height: parent.height
547 height: parent.height