edits
This commit is contained in:
@@ -9,6 +9,9 @@ Singleton {
|
||||
id: root
|
||||
|
||||
property alias gifFolder: adapter.gifFolder
|
||||
property alias scaling: adapter.scaling
|
||||
property alias maxWidth: adapter.maxWidth
|
||||
property alias maxHeight: adapter.maxHeight
|
||||
property string configDir: Quickshell.env("HOME") + "/.config/I-DeskPet"
|
||||
property string configPath: configDir + "/config.json"
|
||||
|
||||
@@ -48,6 +51,9 @@ Singleton {
|
||||
id: adapter
|
||||
|
||||
property string gifFolder: Quickshell.shellDir + "/Gifs"
|
||||
property var scaling: 1
|
||||
property int maxWidth: 200
|
||||
property int maxHeight: 200
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+21
-21
@@ -1,32 +1,32 @@
|
||||
import Quickshell.Io
|
||||
|
||||
Process {
|
||||
id: getGifsProcess
|
||||
required property string gifFolder
|
||||
property list<string> gifsList: []
|
||||
id: getGifsProcess
|
||||
required property string gifFolder
|
||||
property list<string> gifsList: []
|
||||
|
||||
command: ["find", gifFolder, "-type", "f", "-name", "*.gif"]
|
||||
command: ["find", gifFolder, "-type", "f", "-name", "*.gif"]
|
||||
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: {
|
||||
var gifs = this.text.trim().split("\n")
|
||||
if (gifs.length > 0 && gifs[0] !== "") {
|
||||
getGifsProcess.gifsList = gifs
|
||||
} else {
|
||||
getGifsProcess.gifsList = []
|
||||
}
|
||||
}
|
||||
}
|
||||
stdout: StdioCollector {
|
||||
onStreamFinished: {
|
||||
var gifs = this.text.trim().split("\n")
|
||||
if (gifs.length > 0 && gifs[0] !== "") {
|
||||
getGifsProcess.gifsList = gifs
|
||||
} else {
|
||||
getGifsProcess.gifsList = []
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function reload() {
|
||||
gifsList = []
|
||||
running = false
|
||||
running = true
|
||||
}
|
||||
function reload() {
|
||||
gifsList = []
|
||||
running = false
|
||||
running = true
|
||||
}
|
||||
|
||||
onGifFolderChanged: {
|
||||
onGifFolderChanged: {
|
||||
if (running) {
|
||||
reload()
|
||||
getGifsProcess.reload()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import Quickshell.Io
|
||||
import qs.Modules
|
||||
|
||||
Repeater {
|
||||
id: gifRepeater
|
||||
required property list<string> gifsList
|
||||
property int firstWidth
|
||||
property int lastWidth
|
||||
|
||||
model: gifsList
|
||||
Item {
|
||||
id: gifItem
|
||||
@@ -26,8 +26,8 @@ Repeater {
|
||||
|
||||
x: 0
|
||||
y: Screen.height - height
|
||||
width: Math.floor( gif.sourceSize.width / 1.25 )
|
||||
height: Math.floor( gif.sourceSize.height / 1.25 )
|
||||
width: Math.min( Math.floor( gif.sourceSize.width / ConfigLoader.scaling ), Math.floor( ConfigLoader.maxWidth / ConfigLoader.scaling ))
|
||||
height: Math.min( Math.floor( gif.sourceSize.height / ConfigLoader.scaling ), Math.floor( ConfigLoader.maxHeight / ConfigLoader.scaling ))
|
||||
|
||||
AnimatedImage {
|
||||
id: gif
|
||||
|
||||
Reference in New Issue
Block a user