Commit 1a32b397 authored by Ronan Abhamon's avatar Ronan Abhamon

feat(ui/modules/Linphone/Chat/Message): wrap correctly messages

parent 1d286429
......@@ -46,6 +46,7 @@ Item {
left: container.left
right: container.right
}
clip: true
padding: ChatStyle.entry.message.padding
readOnly: true
......@@ -58,7 +59,7 @@ Item {
// See http://doc.qt.io/qt-5/qml-qtquick-text.html#textFormat-prop
// and http://doc.qt.io/qt-5/richtext-html-subset.html
textFormat: Text.RichText // To supports links and imgs.
wrapMode: TextEdit.WordWrap
wrapMode: TextEdit.Wrap
onCursorRectangleChanged: Logic.ensureVisible(cursorRectangle)
onLinkActivated: Qt.openUrlExternally(link)
......@@ -77,6 +78,10 @@ Item {
}
}
// ---------------------------------------------------------------------------
// Extra content.
// ---------------------------------------------------------------------------
Item {
id: content
......
......@@ -51,8 +51,8 @@ function encodeTextToQmlRichFormat (text, options) {
var formattedText = execAll(UriTools.URI_REGEX, text, function (str, valid) {
if (!valid) {
return unscapeHtml(str).replace(/\r\n|\n/g, '<br/>')
.replace(/\t/g, '&nbsp;&nbsp;&nbsp;&nbsp;')
.replace(/ /g, '&nbsp;')
.replace(/\t/g, '&nbsp;&nbsp;&nbsp;&nbsp; ')
.replace(/ /g, '&nbsp; ')
}
var uri = startsWith(str, 'www.') ? 'http://' + str : str
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment