WallPaperPanel/Selector: added LazyLoader and a smooth animation to reveal images once loaded (#78)

Co-authored-by: Sébastien Atoch <sebastien@atracktiv.com>
This commit is contained in:
Quadbyte 2025-08-03 11:12:07 -04:00 committed by GitHub
parent 1175ebd485
commit 186fb315dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 35 additions and 23 deletions

View file

@ -30,7 +30,7 @@ PanelWindow {
}
onVisibleChanged: {
if (wallpaperPanelModal.visible) {
if (wallpaperPanelLoader.active) {
wallpapers = WallpaperManager.wallpaperList
} else {
wallpapers = []
@ -81,7 +81,7 @@ PanelWindow {
id: closeButtonArea
anchors.fill: parent
hoverEnabled: true
onClicked: wallpaperPanelModal.visible = false
onClicked: wallpaperPanelLoader.active = false;
cursorShape: Qt.PointingHandCursor
}
}
@ -136,13 +136,24 @@ PanelWindow {
source: modelData
fillMode: Image.PreserveAspectCrop
asynchronous: true
cache: true
cache: false
smooth: true
mipmap: true
// Limit memory usage
sourceSize.width: 480
sourceSize.height: 270
}
Rectangle {
anchors.fill: parent
color: Theme.textPrimary
opacity: (wallpaperImage.status == Image.Ready) ? 0.0 : 1.0
Behavior on opacity {
NumberAnimation {
duration: 500
easing.type: Easing.OutCubic
}
}
}
MouseArea {
anchors.fill: parent
hoverEnabled: true