feat: add notification module with functionality to display notifications on focused monitor with a NotificationServer as Singleton
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import "../../config"
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
required property var notification
|
||||
|
||||
|
||||
Component.onCompleted: {
|
||||
console.log(
|
||||
"[NotificationBody]:",
|
||||
notification,
|
||||
"notification:",
|
||||
notification.appName
|
||||
)
|
||||
}
|
||||
|
||||
implicitWidth: parent ? parent.width : 300
|
||||
implicitHeight: content.implicitHeight + 20
|
||||
|
||||
color: "transparent"
|
||||
|
||||
border.width: Config.border_width
|
||||
border.color: Colors.primary
|
||||
|
||||
Column {
|
||||
id: content
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: 10
|
||||
|
||||
spacing: 5
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
|
||||
text: root.notification?.appName ?? ""
|
||||
font.family: Config.font
|
||||
font.pixelSize: 18
|
||||
color: Colors.primary
|
||||
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
|
||||
text: root.notification?.summary ?? ""
|
||||
font.family: Config.font
|
||||
font.pixelSize: 22
|
||||
color: Colors.primary
|
||||
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
|
||||
Text {
|
||||
width: parent.width
|
||||
|
||||
text: root.notification?.body ?? ""
|
||||
font.family: Config.font
|
||||
font.pixelSize: 16
|
||||
color: Colors.primary
|
||||
|
||||
wrapMode: Text.Wrap
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user