diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-20 19:35:18 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-20 19:35:18 +1000 |
| commit | 60237cb288821d4cc3379729251179c14534f7bb (patch) | |
| tree | 1a9b81b400664ede7d24a027f4a4ee9410ec4b23 /modules/sidebar/Notif.qml | |
| parent | sidebar/notifs: better expand/close anim (diff) | |
| download | caelestia-shell-60237cb288821d4cc3379729251179c14534f7bb.tar.gz caelestia-shell-60237cb288821d4cc3379729251179c14534f7bb.tar.bz2 caelestia-shell-60237cb288821d4cc3379729251179c14534f7bb.zip | |
sidebar/notifs: normalise non expanded height
Also wrap summary when expanded
Diffstat (limited to 'modules/sidebar/Notif.qml')
| -rw-r--r-- | modules/sidebar/Notif.qml | 14 |
1 files 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 { |