1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-27 23:12:49 -05:00

uncomment toast, and format

This commit is contained in:
bbedward
2025-07-24 19:46:05 -04:00
parent 762785b27a
commit fc52aa2c7a
21 changed files with 575 additions and 427 deletions

View File

@@ -11,7 +11,6 @@ Image {
property string imagePath: ""
property string imageHash: ""
property int maxCacheSize: 512
readonly property string cachePath: imageHash ? `${Paths.stringify(Paths.imagecache)}/${imageHash}@${maxCacheSize}x${maxCacheSize}.png` : ""
asynchronous: true
@@ -19,44 +18,45 @@ Image {
sourceSize.width: maxCacheSize
sourceSize.height: maxCacheSize
smooth: true
onImagePathChanged: {
if (imagePath) {
hashProcess.command = ["sha256sum", Paths.strip(imagePath)]
hashProcess.running = true
hashProcess.command = ["sha256sum", Paths.strip(imagePath)];
hashProcess.running = true;
} else {
source = ""
imageHash = ""
source = "";
imageHash = "";
}
}
onCachePathChanged: {
if (imageHash && cachePath) {
// Ensure cache directory exists before trying to load from cache
Paths.mkdir(Paths.imagecache)
source = cachePath
Paths.mkdir(Paths.imagecache);
source = cachePath;
}
}
onStatusChanged: {
if (source == cachePath && status === Image.Error) {
source = imagePath
source = imagePath;
} else if (source == imagePath && status === Image.Ready && imageHash && cachePath) {
Paths.mkdir(Paths.imagecache)
const grabPath = cachePath
if (visible && width > 0 && height > 0 && Window.window && Window.window.visible) {
grabToImage(res => res.saveToFile(grabPath))
}
Paths.mkdir(Paths.imagecache);
const grabPath = cachePath;
if (visible && width > 0 && height > 0 && Window.window && Window.window.visible)
grabToImage((res) => {
return res.saveToFile(grabPath);
});
}
}
Process {
id: hashProcess
stdout: StdioCollector {
onStreamFinished: {
root.imageHash = text.split(" ")[0]
root.imageHash = text.split(" ")[0];
}
}
}
}
}