parent
d65fb180ad
commit
838eb74eb8
1 changed files with 3 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
import qs.utils
|
import qs.utils
|
||||||
|
import Caelestia
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
@ -8,7 +9,7 @@ Image {
|
||||||
|
|
||||||
property string path
|
property string path
|
||||||
property string hash
|
property string hash
|
||||||
readonly property string cachePath: `${Paths.stringify(Paths.imagecache)}/${hash}@${effectiveWidth}x${effectiveHeight}.png`
|
readonly property url cachePath: `${Paths.imagecache}/${hash}@${effectiveWidth}x${effectiveHeight}.png`
|
||||||
|
|
||||||
readonly property real effectiveScale: QsWindow.window?.devicePixelRatio ?? 1
|
readonly property real effectiveScale: QsWindow.window?.devicePixelRatio ?? 1
|
||||||
readonly property int effectiveWidth: Math.ceil(width * effectiveScale)
|
readonly property int effectiveWidth: Math.ceil(width * effectiveScale)
|
||||||
|
|
@ -31,8 +32,7 @@ Image {
|
||||||
source = path;
|
source = path;
|
||||||
else if (source == path && status === Image.Ready) {
|
else if (source == path && status === Image.Ready) {
|
||||||
Paths.mkdir(Paths.imagecache);
|
Paths.mkdir(Paths.imagecache);
|
||||||
const grabPath = cachePath;
|
CUtils.saveItem(this, cachePath);
|
||||||
grabToImage(res => res.saveToFile(grabPath));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue