From 4d59c72ab6cc8080b4004749a35d92a4a743561b Mon Sep 17 00:00:00 2001 From: lucy Date: Fri, 15 May 2026 20:10:51 +0200 Subject: [PATCH] fix notification styling --- modules/notifications/NotiCard.qml | 41 +++++++++++++++++++--------- modules/notifications/NotiServer.qml | 1 + 2 files changed, 29 insertions(+), 13 deletions(-) diff --git a/modules/notifications/NotiCard.qml b/modules/notifications/NotiCard.qml index f1be13a..965a177 100644 --- a/modules/notifications/NotiCard.qml +++ b/modules/notifications/NotiCard.qml @@ -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 + } } } } diff --git a/modules/notifications/NotiServer.qml b/modules/notifications/NotiServer.qml index 7ecc639..db79793 100644 --- a/modules/notifications/NotiServer.qml +++ b/modules/notifications/NotiServer.qml @@ -10,6 +10,7 @@ Singleton { id: server imageSupported: true bodyImagesSupported: true + onNotification: notification => { notification.tracked = true; }