import Quickshell import QtQuick import ZShell.Config import qs.Components import qs.Helpers import qs.Services Item { id: root required property bool isCurrent required property var modelData // FileSystemEntry-like {path, relativePath} required property real tileHeight required property real tileWidth required property PersistentProperties visibilities // Emitted on click: caller decides whether that means "activate" (if // already current) or "bring to center" (if not) - see CarouselView. signal requestActivate implicitHeight: tileHeight + Tokens.padding.large * 2 implicitWidth: tileWidth CustomClippingRect { id: image anchors.horizontalCenter: parent.horizontalCenter color: Colors.tPalette.m3surfaceContainer implicitHeight: root.tileHeight implicitWidth: root.tileWidth radius: Tokens.rounding.small y: Tokens.padding.large Behavior on implicitWidth { enabled: !root.visibilities.launcher // avoid fighting drag-driven updates Anim { } } MaterialIcon { anchors.centerIn: parent color: Colors.tPalette.m3outline font.pointSize: Tokens.font.size.extraLarge * 2 font.weight: 600 text: "image" } CachingImage { anchors.bottom: parent.bottom anchors.horizontalCenter: parent.horizontalCenter anchors.top: parent.top cache: true fillMode: Image.PreserveAspectCrop height: root.tileHeight path: root.modelData ? root.modelData.path : "" smooth: root.isCurrent width: root.tileHeight * (16 / 9) } StateLayer { onClicked: root.requestActivate() } } }