summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/sidebar/Notif.qml14
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 {