From 61375dc48e37317dda32427a27abd39a0ae57c6c Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Thu, 23 Jun 2022 15:06:06 -0400 Subject: [PATCH] shell: Load wallpaper images asynchronously --- .../configuration/WallpaperSelector.qml | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/shell/contents/configuration/WallpaperSelector.qml b/shell/contents/configuration/WallpaperSelector.qml index 6a80759a..d77652c7 100644 --- a/shell/contents/configuration/WallpaperSelector.qml +++ b/shell/contents/configuration/WallpaperSelector.qml @@ -79,17 +79,21 @@ Controls.Drawer { width: PlasmaCore.Units.iconSizes.large height: width icon: "view-preview" - visible: !walliePreview.visible + visible: !wallpaperPreviewLoader.visible } - Addons.QPixmapItem { - id: walliePreview - anchors.fill: parent + Loader { + id: wallpaperPreviewLoader visible: model.screenshot != null - smooth: true - pixmap: model.screenshot - fillMode: Image.PreserveAspectCrop - + anchors.fill: parent + active: true + asynchronous: true + sourceComponent: Addons.QPixmapItem { + id: walliePreview + smooth: true + pixmap: model.screenshot + fillMode: Image.PreserveAspectCrop + } } } onClicked: {