on xenial help sign in
Fix display of the default wallpaper in the Drawer

It seems that our default setting for AccountsService.backgroundFile references a file that doesn't exist any more. That's fine since the default wallpaper is now handled differently in Unity8. However, we needed to extend that handling to the Drawer. This commit switches from using AccountsService.backgroundFile as our wallpaper source to the cached scaled-down wallpaper held by wallpaperResolver in Shell.qml. Since we're blurring the wallpaper anyway, we can use this scaled-down version and save some memory.

commit305605cedc4ccde2564fb6e8466039d5aff01447 authorDalton Durst <dalton@ubports.com> dateWed 19 Jun 2019, 12:44 (7 years ago) parent12cb790
3 files changed+6−2
qml/Launcher/Drawer.qml+3−2 qml/Launcher/Launcher.qml+2 qml/Shell.qml+1
qml/Launcher/Drawer.qml+3−2
@@ -31,6 +31,7 @@ FocusScope {
3131 readonly property bool moving: appList && appList.moving
3232 readonly property Item searchTextField: searchField
3333 readonly property real delegateWidth: units.gu(10)
34+ property url background
3435 visible: x > -width
3536 property var fullyOpen: x === 0
3637 property var fullyClosed: x === -width
@@ -149,7 +150,7 @@ FocusScope {
149150 Image {
150151 id: background
151152 anchors.fill: parent
152− source: AccountsService.backgroundFile
153+ source: root.background
153154 fillMode: Image.PreserveAspectCrop
154155 }
155156
@@ -159,7 +160,7 @@ FocusScope {
159160 radius: 128
160161 }
161162
162− // Workaround for images with fastblur can't use opacity
163+ // Images with fastblur can't use opacity, so we'll put this on top
163164 Rectangle {
164165 anchors.fill: background
165166 color: parent.color
qml/Launcher/Launcher.qml+2
@@ -33,6 +33,7 @@ FocusScope {
3333 property int topPanelHeight: 0
3434 property bool drawerEnabled: true
3535 property alias privateMode: panel.privateMode
36+ property url background
3637
3738 property int panelWidth: units.gu(10)
3839 property int dragAreaWidth: units.gu(1)
@@ -353,6 +354,7 @@ FocusScope {
353354 bottom: parent.bottom
354355 right: parent.left
355356 }
357+ background: root.background
356358 width: Math.min(root.width, units.gu(81))
357359 panelWidth: panel.width
358360 allowSlidingAnimation: !dragArea.dragging && !launcherDragArea.drag.active && panel.animate
qml/Shell.qml+1
@@ -582,6 +582,7 @@ StyledItem {
582582 topPanelHeight: panel.panelHeight
583583 drawerEnabled: !greeter.active
584584 privateMode: greeter.active
585+ background: wallpaperResolver.cachedBackground
585586
586587 onShowDashHome: showHome()
587588 onLauncherApplicationSelected: {