From 552593424dd43515e7cfb4811e3146b4ab63d7eb Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Mon, 5 May 2025 14:57:58 +1000 Subject: launcher: wallpapers default to current wall --- modules/launcher/WallpaperList.qml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'modules/launcher') diff --git a/modules/launcher/WallpaperList.qml b/modules/launcher/WallpaperList.qml index 4030739..9582957 100644 --- a/modules/launcher/WallpaperList.qml +++ b/modules/launcher/WallpaperList.qml @@ -12,15 +12,19 @@ PathView { required property Scope launcher model: ScriptModel { + readonly property string search: root.search.text.split(" ").slice(1).join(" ") + values: { - const list = Wallpapers.fuzzyQuery(root.search.text.split(" ").slice(1).join(" ")); + const list = Wallpapers.fuzzyQuery(search); if (list.length > 1 && list.length % 2 === 0) list.length -= 1; // Always show odd number return list; } - onValuesChanged: root.currentIndex = 0 + onValuesChanged: root.currentIndex = search ? 0 : values.findIndex(w => w.path === Wallpapers.current) } + Component.onCompleted: currentIndex = Wallpapers.list.findIndex(w => w.path === Wallpapers.current) + implicitWidth: Math.min(LauncherConfig.maxWallpapers, count) * (LauncherConfig.sizes.wallpaperWidth * 0.8 + Appearance.padding.larger * 2) pathItemCount: LauncherConfig.maxWallpapers cacheItemCount: 4 -- cgit v1.2.3-freya