From 60237cb288821d4cc3379729251179c14534f7bb Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sat, 20 Sep 2025 19:35:18 +1000 Subject: sidebar/notifs: normalise non expanded height Also wrap summary when expanded --- modules/sidebar/Notif.qml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/modules/sidebar/Notif.qml b/modules/sidebar/Notif.qml index 6d930b9..e513583 100644 --- a/modules/sidebar/Notif.qml +++ b/modules/sidebar/Notif.qml @@ -13,7 +13,7 @@ StyledRect { required property Props props required property bool expanded - readonly property real nonAnimHeight: expanded ? summary.implicitHeight + expandedContent.implicitHeight + expandedContent.anchors.topMargin + Appearance.padding.normal * 2 : summary.implicitHeight + readonly property real nonAnimHeight: expanded ? summary.implicitHeight + expandedContent.implicitHeight + expandedContent.anchors.topMargin + Appearance.padding.normal * 2 : summaryHeightMetrics.height implicitHeight: nonAnimHeight @@ -34,15 +34,23 @@ StyledRect { timeStr.anchors.margins: Appearance.padding.normal expandedContent.anchors.margins: Appearance.padding.normal summary.width: root.width - Appearance.padding.normal * 2 - timeStr.implicitWidth - Appearance.spacing.small + summary.maximumLineCount: Number.MAX_SAFE_INTEGER } } transitions: Transition { Anim { - properties: "margins,width" + properties: "margins,width,maximumLineCount" } } + TextMetrics { + id: summaryHeightMetrics + + font: summary.font + text: " " // Use this height to prevent weird characters from changing the line height + } + StyledText { id: summary @@ -53,6 +61,8 @@ StyledRect { text: root.modelData.summary color: root.modelData.urgency === "critical" ? Colours.palette.m3onSecondaryContainer : Colours.palette.m3onSurface elide: Text.ElideRight + wrapMode: Text.WordWrap + maximumLineCount: 1 } StyledText { -- cgit v1.2.3-freya