before it goes to ....

This commit is contained in:
2026-02-14 17:20:10 +01:00
parent 175c3463f7
commit b68c139d8d
7 changed files with 12 additions and 33 deletions
View File
+11 -11
View File
@@ -1,6 +1,5 @@
pragma Singleton pragma Singleton
import QtCore
import QtQuick import QtQuick
import Quickshell.Io import Quickshell.Io
import Quickshell import Quickshell
@@ -9,9 +8,6 @@ Singleton {
id: root id: root
property alias gifFolder: adapter.gifFolder 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 configDir: Quickshell.env("HOME") + "/.config/I-DeskPet"
property string configPath: configDir + "/config.json" property string configPath: configDir + "/config.json"
@@ -20,22 +16,27 @@ Singleton {
Process { Process {
id: dirCheck id: dirCheck
running: true running: true
command: ["test", "-d", root.configDir] command: [ "test", "-d", root.configDir ]
onExited: function( exitCode ) { onExited: function( exitCode ) {
if (exitCode !== 0) { if ( exitCode !== 0 ) {
console.log( "creating dir" )
dirCreate.running = true dirCreate.running = true
} }
if ( exitCode !== 1 ) {
console.log( "creating config" )
configCheck.running = true
}
} }
} }
Process { Process {
id: dirCreate id: dirCreate
running: false running: false
command: ["mkdir", "-p", root.configDir] command: [ "mkdir", "-p", root.configDir ]
onExited: function(): void { onExited: function(): void {
console.log("Created config directory:", root.configDir) console.log( "Created config directory:", root.configDir )
} }
} }
@@ -47,13 +48,12 @@ Singleton {
onFileChanged: reload() onFileChanged: reload()
onAdapterUpdated: writeAdapter()
JsonAdapter { JsonAdapter {
id: adapter id: adapter
property string gifFolder: Quickshell.shellDir + "/Gifs" property string gifFolder: Quickshell.shellDir + "/Gifs"
property var scaling: 1
property int maxWidth: 1000
property int maxHeight: 1000
} }
} }
} }
-12
View File
@@ -17,16 +17,4 @@ Process {
} }
} }
} }
function reload() {
gifsList = []
running = false
running = true
}
onGifFolderChanged: {
if (running) {
getGifsProcess.reload()
}
}
} }
+1 -10
View File
@@ -15,15 +15,7 @@ Repeater {
required property int index required property int index
required property string modelData required property string modelData
property int high: ( screen.height - gifItem.height )
// function xPos(): int {
// let xPos = 0;
// const item = gifRepeater.itemAt(index - 1);
// if ( item ) xPos += item.x + item.width;
// return xPos;
// }
// Component.onCompleted: x = xPos()
onXChanged: gifSaved.positionX = gifItem.x onXChanged: gifSaved.positionX = gifItem.x
onYChanged: gifSaved.positionY = gifItem.y onYChanged: gifSaved.positionY = gifItem.y
@@ -53,7 +45,6 @@ Repeater {
property string name: gifNames[gifNames.length - 1].split(".")[0] + ".json" property string name: gifNames[gifNames.length - 1].split(".")[0] + ".json"
property string configDir: Quickshell.env("HOME") + "/.config/I-DeskPet/" property string configDir: Quickshell.env("HOME") + "/.config/I-DeskPet/"
property string configPath: configDir + name property string configPath: configDir + name
// property int yGif: ( screen.height - gifItem.height )
onLoaded: { onLoaded: {
gifItem.x = gifSaved.positionX gifItem.x = gifSaved.positionX
View File
View File
View File