50 lines
1.2 KiB
QML
50 lines
1.2 KiB
QML
import QtQuick // for Text
|
|
import QtQuick.Controls
|
|
import QtQuick.Layouts
|
|
import Quickshell.Services.Notifications
|
|
import Quickshell.Io
|
|
import Quickshell.Widgets
|
|
|
|
Item {
|
|
width: 50
|
|
height: 30
|
|
|
|
ClippingWrapperRectangle {
|
|
radius: 5
|
|
anchors.fill: parent
|
|
Button {
|
|
id: button
|
|
text: ""
|
|
//icon.source: ''
|
|
font.pointSize: 16
|
|
|
|
onClicked: {
|
|
while(server.trackedNotifications.values.length > 0) {
|
|
server.trackedNotifications.values[0].dismiss()
|
|
}
|
|
|
|
text = ""
|
|
}
|
|
implicitHeight: parent.height
|
|
}
|
|
}
|
|
|
|
NotificationServer {
|
|
id: server
|
|
persistenceSupported: true
|
|
imageSupported: true
|
|
actionsSupported: true
|
|
bodyImagesSupported: true
|
|
bodySupported: true
|
|
bodyHyperlinksSupported: true
|
|
inlineReplySupported: true
|
|
actionIconsSupported: true
|
|
|
|
onNotification: (n) => {
|
|
n.tracked = true
|
|
console.log(n?.body)
|
|
button.text = ' ' + (server.trackedNotifications.values.length + 1)
|
|
}
|
|
}
|
|
}
|