It's poppin'
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 294 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 647 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 344 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 298 KiB After Width: | Height: | Size: 294 KiB |
@@ -11,8 +11,6 @@ Singleton {
|
|||||||
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"
|
||||||
|
|
||||||
signal folderChanged()
|
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: dirCheck
|
id: dirCheck
|
||||||
running: true
|
running: true
|
||||||
@@ -23,10 +21,6 @@ Singleton {
|
|||||||
console.log( "creating dir" )
|
console.log( "creating dir" )
|
||||||
dirCreate.running = true
|
dirCreate.running = true
|
||||||
}
|
}
|
||||||
if ( exitCode !== 1 ) {
|
|
||||||
console.log( "creating config" )
|
|
||||||
configCheck.running = true
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+13
-14
@@ -1,20 +1,19 @@
|
|||||||
import Quickshell.Io
|
import QtQuick
|
||||||
|
import Qt.labs.folderlistmodel
|
||||||
|
|
||||||
Process {
|
Item {
|
||||||
id: getGifsProcess
|
id: root
|
||||||
required property string gifFolder
|
required property string gifFolder
|
||||||
property list<string> gifsList: []
|
|
||||||
|
|
||||||
command: ["find", gifFolder, "-type", "f", "-name", "*.gif"]
|
property alias gifsModel: folderModel
|
||||||
|
property alias count: folderModel.count
|
||||||
|
|
||||||
stdout: StdioCollector {
|
FolderListModel {
|
||||||
onStreamFinished: {
|
id: folderModel
|
||||||
var gifs = this.text.trim().split("\n")
|
folder: "file://" + root.gifFolder
|
||||||
if (gifs.length > 0 && gifs[0] !== "") {
|
nameFilters: [ "*.gif" ]
|
||||||
getGifsProcess.gifsList = gifs
|
showDirs: false
|
||||||
} else {
|
showHidden: false
|
||||||
getGifsProcess.gifsList = []
|
sortField: FolderListModel.Name
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+18
-11
@@ -3,28 +3,30 @@ pragma ComponentBehavior: Bound
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
|
import Qt.labs.folderlistmodel
|
||||||
import qs.Modules
|
import qs.Modules
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
id: gifRepeater
|
id: gifRepeater
|
||||||
required property list<string> gifsList
|
required property FolderListModel gifsModel
|
||||||
|
|
||||||
model: gifsList
|
model: gifsModel
|
||||||
Item {
|
Item {
|
||||||
id: gifItem
|
id: gifItem
|
||||||
|
|
||||||
required property int index
|
required property url fileUrl
|
||||||
required property string modelData
|
required property string fileBaseName
|
||||||
property int high: ( screen.height - gifItem.height )
|
property bool loaded: false
|
||||||
|
|
||||||
onXChanged: gifSaved.positionX = gifItem.x
|
visible: gifItem.loaded
|
||||||
onYChanged: gifSaved.positionY = gifItem.y
|
onXChanged: if ( gifItem.loaded ) gifSaved.positionX = gifItem.x
|
||||||
|
onYChanged: if ( gifItem.loaded ) gifSaved.positionY = gifItem.y
|
||||||
width: Math.floor( gif.sourceSize.width / gifSaved.scaling )
|
width: Math.floor( gif.sourceSize.width / gifSaved.scaling )
|
||||||
height: Math.floor( gif.sourceSize.height / gifSaved.scaling )
|
height: Math.floor( gif.sourceSize.height / gifSaved.scaling )
|
||||||
|
|
||||||
AnimatedImage {
|
AnimatedImage {
|
||||||
id: gif
|
id: gif
|
||||||
source: gifItem.modelData
|
source: gifItem.fileUrl
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
@@ -34,21 +36,26 @@ Repeater {
|
|||||||
gifSaved.scaling = Math.max( 1, ( gifSaved.scaling + 0.1 * ( wheel.angleDelta.y / 120 ) ) )
|
gifSaved.scaling = Math.max( 1, ( gifSaved.scaling + 0.1 * ( wheel.angleDelta.y / 120 ) ) )
|
||||||
}
|
}
|
||||||
|
|
||||||
onClicked: gifSaved.scaling = 1
|
onDoubleClicked: gifSaved.scaling = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
FileView {
|
FileView {
|
||||||
id: watcher
|
id: watcher
|
||||||
path: configPath
|
path: configPath
|
||||||
|
|
||||||
property list<string> gifNames: gifItem.modelData.split("/")
|
property string name: gifItem.fileBaseName + ".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
|
||||||
|
|
||||||
onLoaded: {
|
onLoaded: {
|
||||||
gifItem.x = gifSaved.positionX
|
gifItem.x = gifSaved.positionX
|
||||||
gifItem.y = gifSaved.positionY
|
gifItem.y = gifSaved.positionY
|
||||||
|
gifItem.loaded = true
|
||||||
|
}
|
||||||
|
|
||||||
|
onLoadFailed: {
|
||||||
|
writeAdapter()
|
||||||
|
gifItem.loaded = true
|
||||||
}
|
}
|
||||||
|
|
||||||
watchChanges: true
|
watchChanges: true
|
||||||
|
|||||||
@@ -32,19 +32,21 @@ PanelWindow {
|
|||||||
top: 0
|
top: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
GetGifs {
|
GetGifs {
|
||||||
id: getGifs
|
id: getGifs
|
||||||
gifFolder: ConfigLoader.gifFolder
|
gifFolder: ConfigLoader.gifFolder
|
||||||
running: true
|
}
|
||||||
}
|
|
||||||
|
GifsLoader {
|
||||||
GifsLoader {
|
id: gifLoader
|
||||||
id: gifLoader
|
gifsModel: getGifs.gifsModel
|
||||||
gifsList: getGifs.gifsList
|
onItemAdded: function( index, item ) {
|
||||||
onItemAdded: function( index, item ) {
|
mainWindow.repeaterItems = Array.from( { length: gifLoader.count }, (_, i) => gifLoader.itemAt(i) ).filter( v => v !== null )
|
||||||
mainWindow.repeaterItems.push( item )
|
}
|
||||||
}
|
onItemRemoved: function( index, item ) {
|
||||||
}
|
mainWindow.repeaterItems = Array.from( { length: gifLoader.count }, (_, i) => gifLoader.itemAt(i) ).filter( v => v !== null )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Variants {
|
Variants {
|
||||||
id: maskVariants
|
id: maskVariants
|
||||||
|
|||||||
Reference in New Issue
Block a user