launcher: wallpapers default to current wall
This commit is contained in:
parent
1fdaf24526
commit
552593424d
1 changed files with 6 additions and 2 deletions
|
|
@ -12,15 +12,19 @@ PathView {
|
||||||
required property Scope launcher
|
required property Scope launcher
|
||||||
|
|
||||||
model: ScriptModel {
|
model: ScriptModel {
|
||||||
|
readonly property string search: root.search.text.split(" ").slice(1).join(" ")
|
||||||
|
|
||||||
values: {
|
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)
|
if (list.length > 1 && list.length % 2 === 0)
|
||||||
list.length -= 1; // Always show odd number
|
list.length -= 1; // Always show odd number
|
||||||
return list;
|
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)
|
implicitWidth: Math.min(LauncherConfig.maxWallpapers, count) * (LauncherConfig.sizes.wallpaperWidth * 0.8 + Appearance.padding.larger * 2)
|
||||||
pathItemCount: LauncherConfig.maxWallpapers
|
pathItemCount: LauncherConfig.maxWallpapers
|
||||||
cacheItemCount: 4
|
cacheItemCount: 4
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue