working notifications

This commit is contained in:
lucy 2026-05-14 22:33:06 +02:00
commit e1504bfc92
5 changed files with 112 additions and 0 deletions

View file

@ -0,0 +1,44 @@
import Quickshell
import Quickshell.Widgets
import QtQuick.Layouts
import QtQuick
import qs
import qs.settings
import qs.widgets
WrapperRectangle {
id: root
required property var notification
implicitWidth: 300
implicitHeight: 100
radius: Config.rounding
anchors.right: parent?.right
color: Colors.base01
child: WrapperMouseArea {
RowLayout {
anchors.fill: parent
IconImage {
id: appIcon
Layout.leftMargin: 16
source: root.notification.image ? root.notification.image : ''
implicitSize: 48
}
ColumnLayout {
Layout.alignment: Qt.AlignLeft
StyledText {
id: title
text: root.notification?.summary == null ? '' : root.notification.summary
}
StyledText {
id: body
text: root.notification.body ? root.notification.body : ''
}
}
}
acceptedButtons: Qt.LeftButton
cursorShape: Qt.PointingHandCursor
onClicked: {
root.notification.dismiss();
}
}
}