lots of changes
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
import ZShell.Internal
|
||||
import Quickshell
|
||||
import QtQuick
|
||||
import qs.Paths
|
||||
|
||||
Image {
|
||||
id: root
|
||||
|
||||
property alias path: manager.path
|
||||
|
||||
asynchronous: true
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
|
||||
Connections {
|
||||
target: QsWindow.window
|
||||
|
||||
function onDevicePixelRatioChanged(): void {
|
||||
manager.updateSource();
|
||||
}
|
||||
}
|
||||
|
||||
CachingImageManager {
|
||||
id: manager
|
||||
|
||||
item: root
|
||||
cacheDir: Qt.resolvedUrl(Paths.imagecache)
|
||||
}
|
||||
}
|
||||
@@ -4,11 +4,33 @@ import Quickshell
|
||||
import Quickshell.Io
|
||||
import qs.Config
|
||||
import qs.Modules
|
||||
import qs.Helpers
|
||||
import ZShell.Models
|
||||
|
||||
Searcher {
|
||||
id: root
|
||||
|
||||
readonly property string currentNamePath: WallpaperPath.currentWallpaperPath
|
||||
|
||||
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
|
||||
@@ -16,6 +38,15 @@ Searcher {
|
||||
forward: false
|
||||
})
|
||||
|
||||
FileView {
|
||||
path: root.currentNamePath
|
||||
watchChanges: true
|
||||
onFileChanged: reload()
|
||||
onLoaded: {
|
||||
root.actualCurrent = this.text;
|
||||
}
|
||||
}
|
||||
|
||||
FileSystemModel {
|
||||
id: wallpapers
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
import QtQuick
|
||||
|
||||
Text {
|
||||
renderType: Text.NativeRendering
|
||||
textFormat: Text.PlainText
|
||||
}
|
||||
Reference in New Issue
Block a user