From 00d3c1a472888817d7649391d4a8485c5fc6f6f5 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sat, 3 May 2025 23:56:37 +1000 Subject: feat: launcher wallpaper selector --- modules/launcher/WallpaperList.qml | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 modules/launcher/WallpaperList.qml (limited to 'modules/launcher/WallpaperList.qml') diff --git a/modules/launcher/WallpaperList.qml b/modules/launcher/WallpaperList.qml new file mode 100644 index 0000000..ecf7976 --- /dev/null +++ b/modules/launcher/WallpaperList.qml @@ -0,0 +1,44 @@ +import "root:/widgets" +import "root:/services" +import "root:/config" +import Quickshell +import QtQuick +import QtQuick.Controls + +PathView { + id: root + + required property TextField search + required property Scope launcher + + model: ScriptModel { + values: { + const list = Wallpapers.fuzzyQuery(root.search.text.split(" ").slice(1).join(" ")); + if (list.length > 1 && list.length % 2 === 0) + list.length -= 1; // Always show odd number + return list; + } + onValuesChanged: root.currentIndex = 0 + } + + implicitWidth: Math.min(LauncherConfig.maxWallpapers, count) * (LauncherConfig.sizes.wallpaperWidth * 0.8 + Appearance.padding.larger * 2) + pathItemCount: LauncherConfig.maxWallpapers + cacheItemCount: 4 + + snapMode: PathView.SnapToItem + preferredHighlightBegin: 0.5 + preferredHighlightEnd: 0.5 + highlightRangeMode: PathView.StrictlyEnforceRange + highlightMoveDuration: Appearance.anim.durations.short + + delegate: WallpaperItem {} + + path: Path { + startY: root.height / 2 + + PathLine { + x: root.width + relativeY: 0 + } + } +} -- cgit v1.2.3-freya