diff --git a/applets/notifications/package/contents/ui/NotificationItem.qml b/applets/notifications/package/contents/ui/NotificationItem.qml --- a/applets/notifications/package/contents/ui/NotificationItem.qml +++ b/applets/notifications/package/contents/ui/NotificationItem.qml @@ -71,12 +71,16 @@ property var actionNames: [] property var actionLabels: [] - property int headingLeftPadding: 0 - property int headingRightPadding: 0 + property int headingLeftPadding: LayoutMirroring.enabled ? 0 : units.smallSpacing + property int headingRightPadding: LayoutMirroring.enabled ? units.smallSpacing : 0 + property int headingTopPadding: 0 + + property int bodyLeftPadding: units.smallSpacing + property int bodyRightPadding: units.smallSpacing property int thumbnailLeftPadding: 0 property int thumbnailRightPadding: 0 - property int thumbnailTopPadding: 0 + property int thumbnailTopPadding: -units.smallSpacing property int thumbnailBottomPadding: 0 readonly property bool menuOpen: bodyLabel.contextMenu !== null @@ -96,13 +100,14 @@ signal resumeJobClicked signal killJobClicked - spacing: units.smallSpacing + spacing: units.smallSpacing * 2 NotificationHeader { id: notificationHeading Layout.fillWidth: true Layout.leftMargin: notificationItem.headingLeftPadding Layout.rightMargin: notificationItem.headingRightPadding + Layout.topMargin: notificationItem.headingTopPadding inGroup: notificationItem.inGroup @@ -124,6 +129,9 @@ RowLayout { id: bodyRow Layout.fillWidth: true + Layout.leftMargin: notificationItem.bodyLeftPadding + Layout.rightMargin: notificationItem.bodyRightPadding + Layout.bottomMargin: units.smallSpacing spacing: units.smallSpacing ColumnLayout { @@ -251,6 +259,7 @@ Loader { id: jobLoader Layout.fillWidth: true + Layout.leftMargin: notificationItem.bodyLeftPadding active: notificationItem.notificationType === NotificationManager.Notifications.JobType visible: active sourceComponent: JobItem { @@ -276,6 +285,9 @@ RowLayout { Layout.fillWidth: true + Layout.leftMargin: units.smallSpacing + Layout.rightMargin: units.smallSpacing + Layout.bottomMargin: units.smallSpacing visible: actionRepeater.count > 0 // Notification actions @@ -318,7 +330,7 @@ Layout.leftMargin: notificationItem.thumbnailLeftPadding Layout.rightMargin: notificationItem.thumbnailRightPadding // no change in Layout.topMargin to keep spacing to notification text consistent - Layout.topMargin: 0 + Layout.topMargin: notificationItem.thumbnailTopPadding Layout.bottomMargin: notificationItem.thumbnailBottomPadding Layout.fillWidth: true active: notificationItem.urls.length > 0 diff --git a/applets/notifications/package/contents/ui/NotificationPopup.qml b/applets/notifications/package/contents/ui/NotificationPopup.qml --- a/applets/notifications/package/contents/ui/NotificationPopup.qml +++ b/applets/notifications/package/contents/ui/NotificationPopup.qml @@ -172,17 +172,15 @@ NotificationItem { id: notificationItem - // let the item bleed into the dialog margins so the close button margins cancel out - y: closable || dismissable || configurable ? -notificationPopup.margins.top : 0 - headingRightPadding: -notificationPopup.margins.right + // Make top padding match for notifications with no top-right button + y: closable || dismissable || configurable ? 0 : notificationPopup.margins.top width: parent.width hovered: area.containsMouse maximumLineCount: 8 bodyCursorShape: notificationPopup.hasDefaultAction ? Qt.PointingHandCursor : 0 thumbnailLeftPadding: -notificationPopup.margins.left thumbnailRightPadding: -notificationPopup.margins.right - thumbnailTopPadding: -notificationPopup.margins.top thumbnailBottomPadding: -notificationPopup.margins.bottom closable: true