fix notification styling

This commit is contained in:
lucy 2026-05-15 20:10:51 +02:00
commit 4d59c72ab6
2 changed files with 29 additions and 13 deletions

View file

@ -11,11 +11,18 @@ WrapperRectangle {
required property var notification
required property ShellScreen nScreen
implicitWidth: nScreen.width / 6
implicitHeight: 80
implicitHeight: 100
radius: Config.rounding
anchors.right: parent?.right
color: Colors.base01
clip: true
Timer {
id: dismissTimer
running: true
interval: 5000
repeat: false
onTriggered: root.notification.dismiss()
}
child: WrapperMouseArea {
id: mouseHandler
child: RowLayout {
@ -34,6 +41,7 @@ WrapperRectangle {
Layout.fillHeight: true
Layout.leftMargin: appIcon.visible ? 0 : 16
RowLayout {
Layout.alignment: Qt.AlignTop
MaterialIcon {
text: "\ue7f4"
font.pixelSize: 12
@ -44,18 +52,25 @@ WrapperRectangle {
opacity: 0.4
}
}
StyledText {
id: title
text: root.notification?.summary == null ? '' : root.notification.summary
elide: Text.ElideRight
Layout.fillWidth: true
}
StyledText {
id: body
text: root.notification?.body ? root.notification.body : ''
elide: Text.ElideRight
Layout.fillWidth: true
opacity: 0.6
ColumnLayout {
spacing: 0
StyledText {
id: title
Layout.bottomMargin: 0
Layout.topMargin: 5
Layout.alignment: Qt.AlignBottom
Layout.fillWidth: true
text: root.notification?.summary == null ? '' : root.notification.summary
elide: Text.ElideRight
}
StyledText {
id: body
Layout.alignment: Qt.AlignBottom
text: root.notification?.body ? root.notification.body : ''
elide: Text.ElideRight
Layout.fillWidth: true
opacity: 0.6
}
}
}
}

View file

@ -10,6 +10,7 @@ Singleton {
id: server
imageSupported: true
bodyImagesSupported: true
onNotification: notification => {
notification.tracked = true;
}