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