1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-27 15:02:50 -05:00

notifications: add image persistence

This commit is contained in:
bbedward
2026-01-03 19:56:08 -05:00
parent 913bb2ff67
commit aa72eacae7
5 changed files with 93 additions and 5 deletions

View File

@@ -1,6 +1,5 @@
import QtQuick
import QtQuick.Effects
import Quickshell
import qs.Common
import qs.Widgets
@@ -13,6 +12,19 @@ Rectangle {
property bool hasImage: imageSource !== ""
property alias imageStatus: internalImage.status
signal imageSaved(string filePath)
function saveImageToFile(filePath) {
if (internalImage.status !== Image.Ready)
return false;
internalImage.grabToImage(function (result) {
if (result && result.saveToFile(filePath)) {
root.imageSaved(filePath);
}
});
return true;
}
radius: width / 2
color: Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.1)
border.color: "transparent"
@@ -67,7 +79,6 @@ Rectangle {
visible: (internalImage.status !== Image.Ready || root.imageSource === "") && root.fallbackIcon !== ""
}
StyledText {
anchors.centerIn: parent
visible: root.imageSource === "" && root.fallbackIcon === "" && root.fallbackText !== ""