From e425a1701bf427318007d2f94e4db9bd713edf60 Mon Sep 17 00:00:00 2001 From: zach Date: Wed, 20 May 2026 14:34:11 +0200 Subject: [PATCH] small fix for wallpaper grid --- Modules/Settings/Controls/WallpaperGrid.qml | 76 ++++++++++----------- 1 file changed, 35 insertions(+), 41 deletions(-) diff --git a/Modules/Settings/Controls/WallpaperGrid.qml b/Modules/Settings/Controls/WallpaperGrid.qml index 764b10e..62bcd1b 100644 --- a/Modules/Settings/Controls/WallpaperGrid.qml +++ b/Modules/Settings/Controls/WallpaperGrid.qml @@ -23,26 +23,13 @@ GridView { delegate: Item { required property int index readonly property bool isCurrent: modelData && modelData.path === Wallpapers.actualCurrent - readonly property real itemMargin: Appearance.spacing.normal / 2 - readonly property real itemRadius: Appearance.rounding.normal + readonly property real itemMargin: Appearance.spacing.normal + readonly property real itemRadius: Appearance.rounding.small required property var modelData height: root.cellHeight width: root.cellWidth - StateLayer { - function onClicked(): void { - Wallpapers.setWallpaper(modelData.path); - } - - anchors.bottomMargin: itemMargin - anchors.fill: parent - anchors.leftMargin: itemMargin - anchors.rightMargin: itemMargin - anchors.topMargin: itemMargin - radius: itemRadius - } - CustomClippingRect { id: image @@ -53,8 +40,6 @@ GridView { anchors.topMargin: itemMargin antialiasing: true color: DynamicColors.tPalette.m3surfaceContainer - layer.enabled: true - layer.smooth: true radius: itemRadius CachingImage { @@ -100,6 +85,33 @@ GridView { } } + Rectangle { + anchors.fill: parent + antialiasing: true + border.color: DynamicColors.palette.m3primary + border.width: isCurrent ? 2 : 0 + color: "transparent" + radius: itemRadius + 2 + smooth: true + + Behavior on border.width { + NumberAnimation { + duration: 150 + easing.type: Easing.OutQuad + } + } + + MaterialIcon { + anchors.margins: Appearance.padding.small + anchors.right: parent.right + anchors.top: parent.top + color: DynamicColors.palette.m3primary + font.pointSize: Appearance.font.size.large + text: "check_circle" + visible: isCurrent + } + } + Timer { id: fallbackTimer @@ -112,35 +124,17 @@ GridView { } } - Rectangle { + StateLayer { + function onClicked(): void { + Wallpapers.setWallpaper(modelData.path); + } + anchors.bottomMargin: itemMargin anchors.fill: parent anchors.leftMargin: itemMargin anchors.rightMargin: itemMargin anchors.topMargin: itemMargin - antialiasing: true - border.color: DynamicColors.palette.m3primary - border.width: isCurrent ? 2 : 0 - color: "transparent" - radius: itemRadius - border.width - smooth: true - - Behavior on border.width { - NumberAnimation { - duration: 150 - easing.type: Easing.OutQuad - } - } - - MaterialIcon { - anchors.margins: Appearance.padding.small - anchors.right: parent.right - anchors.top: parent.top - color: DynamicColors.palette.m3primary - font.pointSize: Appearance.font.size.large - text: "check_circle" - visible: isCurrent - } + radius: itemRadius } } }