summaryrefslogtreecommitdiff
path: root/modules/launcher/WallpaperList.qml
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-03 23:56:37 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-03 23:56:37 +1000
commit00d3c1a472888817d7649391d4a8485c5fc6f6f5 (patch)
tree45b351c62f61ede55acfc209dde686f1c161a942 /modules/launcher/WallpaperList.qml
parentfeat: use multieffect instead of qt5compat (diff)
downloadcaelestia-shell-00d3c1a472888817d7649391d4a8485c5fc6f6f5.tar.gz
caelestia-shell-00d3c1a472888817d7649391d4a8485c5fc6f6f5.tar.bz2
caelestia-shell-00d3c1a472888817d7649391d4a8485c5fc6f6f5.zip
feat: launcher wallpaper selector
Diffstat (limited to 'modules/launcher/WallpaperList.qml')
-rw-r--r--modules/launcher/WallpaperList.qml44
1 files changed, 44 insertions, 0 deletions
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
+ }
+ }
+}