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,14 +52,20 @@ WrapperRectangle {
opacity: 0.4 opacity: 0.4
} }
} }
ColumnLayout {
spacing: 0
StyledText { StyledText {
id: title id: title
Layout.bottomMargin: 0
Layout.topMargin: 5
Layout.alignment: Qt.AlignBottom
Layout.fillWidth: true
text: root.notification?.summary == null ? '' : root.notification.summary text: root.notification?.summary == null ? '' : root.notification.summary
elide: Text.ElideRight elide: Text.ElideRight
Layout.fillWidth: true
} }
StyledText { StyledText {
id: body id: body
Layout.alignment: Qt.AlignBottom
text: root.notification?.body ? root.notification.body : '' text: root.notification?.body ? root.notification.body : ''
elide: Text.ElideRight elide: Text.ElideRight
Layout.fillWidth: true Layout.fillWidth: true
@ -59,6 +73,7 @@ WrapperRectangle {
} }
} }
} }
}
acceptedButtons: Qt.LeftButton acceptedButtons: Qt.LeftButton
cursorShape: Qt.PointingHandCursor cursorShape: Qt.PointingHandCursor
hoverEnabled: true hoverEnabled: true

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;
} }