Files
z-bar-qt/Helpers/SearchWallpapers.qml
T
2025-11-20 22:11:44 +01:00

47 lines
989 B
QML

pragma Singleton
import Quickshell
import Quickshell.Io
import qs.Config
import qs.Modules
import qs.Helpers
import ZShell.Models
Searcher {
id: root
property bool showPreview: false
readonly property string current: showPreview ? previewPath : actualCurrent
property string previewPath
property string actualCurrent: WallpaperPath.currentWallpaperPath
function setWallpaper(path: string): void {
actualCurrent = path;
WallpaperPath.currentWallpaperPath = path;
}
function preview(path: string): void {
previewPath = path;
showPreview = true;
}
function stopPreview(): void {
showPreview = false;
}
list: wallpapers.entries
key: "relativePath"
useFuzzy: true
extraOpts: useFuzzy ? ({}) : ({
forward: false
})
FileSystemModel {
id: wallpapers
recursive: true
path: Config.wallpaperPath
filter: FileSystemModel.Images
}
}