nosignal-shell/modules/launcher/WallpaperList.qml
2 * r + 2 * t 4c84e4fff3 feat: actually set wallpaper
Make launcher wallpaper picker actually work
2025-05-04 16:29:34 +10:00

58 lines
1.4 KiB
QML

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 {
launcher: root.launcher
}
path: Path {
startY: root.height / 2
PathAttribute {
name: "z"
value: 0
}
PathLine {
x: root.width / 2
relativeY: 0
}
PathAttribute {
name: "z"
value: 1
}
PathLine {
x: root.width
relativeY: 0
}
}
}