notifications: prevent summaries from spilling

This commit is contained in:
end-4
2025-09-26 22:55:14 +02:00
parent 9eade626aa
commit 6394fe049d
@@ -16,6 +16,7 @@ Item { // Notification item area
property bool onlyNotification: false
property real fontSize: Appearance.font.pixelSize.small
property real padding: onlyNotification ? 0 : 8
property real summaryElideRatio: 0.85
property real dragConfirmThreshold: 70 // Drag further to discard notification
property real dismissOvershoot: notificationIcon.implicitWidth + 20 // Account for gaps and bouncy animations
@@ -58,6 +59,12 @@ Item { // Notification item area
destroyAnimation.running = true;
}
TextMetrics {
id: summaryTextMetrics
font.pixelSize: root.fontSize
text: root.notificationObject.summary || ""
}
SequentialAnimation { // Drag finish animation
id: destroyAnimation
running: false
@@ -164,9 +171,9 @@ Item { // Notification item area
visible: !root.onlyNotification || !root.expanded
Layout.fillWidth: true
implicitHeight: summaryText.implicitHeight
// Layout.fillWidth: true
StyledText {
id: summaryText
Layout.fillWidth: summaryTextMetrics.width >= summaryRow.width * root.summaryElideRatio
visible: !root.onlyNotification
font.pixelSize: root.fontSize
color: Appearance.colors.colOnLayer3