fix: segfault

This commit is contained in:
ferreo 2025-07-13 17:31:46 +01:00
parent de0aa60dd3
commit 17f99eafd0

View file

@ -23,7 +23,15 @@ PanelWindow {
Connections {
target: WallpaperManager
function onWallpaperListChanged() {
wallpapers = WallpaperManager.wallpaperList;
wallpapers = WallpaperManager.wallpaperList
}
}
onVisibleChanged: {
if (wallpaperPanelModal.visible) {
wallpapers = WallpaperManager.wallpaperList
} else {
wallpapers = []
}
}
@ -104,7 +112,7 @@ PanelWindow {
cellWidth: Math.max(120, (scrollView.width / 3) - 12)
cellHeight: cellWidth * 0.6
model: wallpapers
cacheBuffer: 0
cacheBuffer: 32
leftMargin: 8
rightMargin: 8
topMargin: 8
@ -112,14 +120,7 @@ PanelWindow {
delegate: Item {
width: wallpaperGrid.cellWidth - 8
height: wallpaperGrid.cellHeight - 8
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked: {
WallpaperManager.changeWallpaper(modelData);
}
ClippingWrapperRectangle {
ClippingRectangle {
id: wallpaperItem
anchors.fill: parent
anchors.margins: 4
@ -137,6 +138,12 @@ PanelWindow {
sourceSize.width: Math.min(width, 150)
sourceSize.height: Math.min(height, 90)
}
MouseArea {
anchors.fill: parent
hoverEnabled: true
onClicked: {
WallpaperManager.changeWallpaper(modelData);
}
}
}
}