diff --git a/.config/quickshell/ii/modules/common/widgets/NotificationItem.qml b/.config/quickshell/ii/modules/common/widgets/NotificationItem.qml index 4f87b4fdd..3aafdc400 100644 --- a/.config/quickshell/ii/modules/common/widgets/NotificationItem.qml +++ b/.config/quickshell/ii/modules/common/widgets/NotificationItem.qml @@ -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