Ensure linebreaks are respected
This commit is contained in:
@@ -47,6 +47,7 @@ Rectangle {
|
|||||||
source.indexOf("opera") >= 0
|
source.indexOf("opera") >= 0
|
||||||
}
|
}
|
||||||
readonly property string sanitizedBody: sanitizeBody(body)
|
readonly property string sanitizedBody: sanitizeBody(body)
|
||||||
|
readonly property string styledBody: sanitizedBody.replace(/\r\n|\r|\n/g, "<br/>")
|
||||||
|
|
||||||
readonly property color dimColor: Qt.darker(Color.notifications.text, 1.4)
|
readonly property color dimColor: Qt.darker(Color.notifications.text, 1.4)
|
||||||
readonly property color bodyColor: Qt.darker(Color.notifications.text, 1.15)
|
readonly property color bodyColor: Qt.darker(Color.notifications.text, 1.15)
|
||||||
@@ -167,7 +168,7 @@ Rectangle {
|
|||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: Style.space(2)
|
Layout.topMargin: Style.space(2)
|
||||||
visible: root.sanitizedBody.length > 0
|
visible: root.sanitizedBody.length > 0
|
||||||
text: root.sanitizedBody
|
text: root.styledBody
|
||||||
textFormat: Text.StyledText
|
textFormat: Text.StyledText
|
||||||
font.family: "Liberation Sans"
|
font.family: "Liberation Sans"
|
||||||
color: root.bodyColor
|
color: root.bodyColor
|
||||||
|
|||||||
Reference in New Issue
Block a user