Switched to qmlformat.

This commit is contained in:
ItsLemmy
2025-11-16 17:07:03 -05:00
parent 32905224b9
commit 3ff5b7639f
223 changed files with 9970 additions and 9658 deletions
+9 -9
View File
@@ -3,8 +3,8 @@ pragma ComponentBehavior
import QtQuick
import Quickshell
import Quickshell.Io
import qs.Commons
import "../Helpers/sha256.js" as Checksum
import qs.Commons
Image {
id: root
@@ -22,31 +22,31 @@ Image {
smooth: true
onImagePathChanged: {
if (imagePath) {
imageHash = Checksum.sha256(imagePath)
imageHash = Checksum.sha256(imagePath);
// Logger.i("NImageCached", imagePath, imageHash)
} else {
source = ""
imageHash = ""
source = "";
imageHash = "";
}
}
onCachePathChanged: {
if (imageHash && cachePath) {
// Try to load the cached version, failure will be detected below in onStatusChanged
// Failure is expected and warnings are ok in the console. Don't try to improve without consulting.
source = cachePath
source = cachePath;
}
}
onStatusChanged: {
if (source == cachePath && status === Image.Error) {
// Cached image was not available, show the original
source = imagePath
source = imagePath;
} else if (source == imagePath && status === Image.Ready && imageHash && cachePath) {
// Original image is shown and fully loaded, time to cache it
const grabPath = cachePath
const grabPath = cachePath;
if (visible && width > 0 && height > 0 && Window.window && Window.window.visible)
grabToImage(res => {
return res.saveToFile(grabPath)
})
return res.saveToFile(grabPath);
});
}
}
}