1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-08 12:13:31 -04:00

fix(Notifications): restore long message content from overflowing

- Addtional security escape patch
- Tweak Notification Center width
This commit is contained in:
purian23
2026-05-31 22:38:50 -04:00
parent b1ac6b0ef9
commit a44bef5796
5 changed files with 21 additions and 14 deletions
@@ -395,7 +395,7 @@ Rectangle {
property bool hasMoreText: truncated
text: fullText
textFormat: Text.RichText
textFormat: Text.StyledText
color: Theme.surfaceVariantText
font.pixelSize: Theme.fontSizeSmall
width: parent.width
@@ -561,9 +561,9 @@ Rectangle {
height: {
if (!messageExpanded)
return expandedBaseHeight;
const twoLineHeight = bodyText.font.pixelSize * 1.2 * 2;
if (bodyText.implicitHeight > twoLineHeight + 2)
return expandedBaseHeight + bodyText.implicitHeight - twoLineHeight;
const collapsedBodyHeight = bodyText.collapsedLineHeight;
if (bodyText.implicitHeight > collapsedBodyHeight + 2)
return expandedBaseHeight + bodyText.implicitHeight - collapsedBodyHeight;
return expandedBaseHeight;
}
radius: Theme.cornerRadius
@@ -703,15 +703,17 @@ Rectangle {
StyledText {
id: bodyText
readonly property real collapsedLineCount: compactMode ? 1 : 2
readonly property real collapsedLineHeight: font.pixelSize * 1.2 * collapsedLineCount
property bool hasMoreText: truncated
text: modelData?.htmlBody || ""
textFormat: Text.RichText
textFormat: Text.StyledText
color: Theme.surfaceVariantText
font.pixelSize: Theme.fontSizeSmall
width: parent.width
elide: messageExpanded ? Text.ElideNone : Text.ElideRight
maximumLineCount: messageExpanded ? -1 : 2
maximumLineCount: messageExpanded ? -1 : collapsedLineCount
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
visible: text.length > 0
linkColor: Theme.primary