progress
This commit is contained in:
parent
cc71593a9b
commit
1a27b905bf
16 changed files with 622 additions and 177 deletions
42
services/Notification.qml
Normal file
42
services/Notification.qml
Normal file
|
@ -0,0 +1,42 @@
|
|||
pragma Singleton
|
||||
pragma ComponentBehavior: Bound
|
||||
|
||||
import Quickshell
|
||||
import Quickshell.Services.Notifications
|
||||
import QtQuick
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
|
||||
readonly property list<Notif> list: []
|
||||
readonly property list<Notif> popups: list.filter(n => n.popup)
|
||||
|
||||
NotificationServer {
|
||||
id: server
|
||||
|
||||
keepOnReload: false
|
||||
|
||||
onNotification: notif => {
|
||||
notif.tracked = true;
|
||||
|
||||
root.list.push(notifComp.createObject(root, {
|
||||
popup: true,
|
||||
notification: notif
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
component Notif: QtObject {
|
||||
property bool popup
|
||||
readonly property date time: new Date()
|
||||
|
||||
required property Notification notification
|
||||
readonly property string summary: notification.summary
|
||||
}
|
||||
|
||||
Component {
|
||||
id: notifComp
|
||||
|
||||
Notif {}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue