diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/launcher/WallpaperList.qml | 8 |
1 files changed, 6 insertions, 2 deletions
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 |