summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-05 14:57:58 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-05-05 14:57:58 +1000
commit552593424dd43515e7cfb4811e3146b4ab63d7eb (patch)
tree6cb82b39767862dd584df18f634460b5847e8975
parentrefactor: move colours to separate service (diff)
downloadcaelestia-shell-552593424dd43515e7cfb4811e3146b4ab63d7eb.tar.gz
caelestia-shell-552593424dd43515e7cfb4811e3146b4ab63d7eb.tar.bz2
caelestia-shell-552593424dd43515e7cfb4811e3146b4ab63d7eb.zip
launcher: wallpapers default to current wall
-rw-r--r--modules/launcher/WallpaperList.qml8
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