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 { ...@@ -46,6 +46,7 @@ Item {
left: container.left left: container.left
right: container.right right: container.right
} }
clip: true clip: true
padding: ChatStyle.entry.message.padding padding: ChatStyle.entry.message.padding
readOnly: true readOnly: true
...@@ -58,7 +59,7 @@ Item { ...@@ -58,7 +59,7 @@ Item {
// See http://doc.qt.io/qt-5/qml-qtquick-text.html#textFormat-prop // See http://doc.qt.io/qt-5/qml-qtquick-text.html#textFormat-prop
// and http://doc.qt.io/qt-5/richtext-html-subset.html // and http://doc.qt.io/qt-5/richtext-html-subset.html
textFormat: Text.RichText // To supports links and imgs. textFormat: Text.RichText // To supports links and imgs.
wrapMode: TextEdit.WordWrap wrapMode: TextEdit.Wrap
onCursorRectangleChanged: Logic.ensureVisible(cursorRectangle) onCursorRectangleChanged: Logic.ensureVisible(cursorRectangle)
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(link)
...@@ -77,6 +78,10 @@ Item { ...@@ -77,6 +78,10 @@ Item {
} }
} }
// ---------------------------------------------------------------------------
// Extra content.
// ---------------------------------------------------------------------------
Item { Item {
id: content id: content
......
...@@ -51,8 +51,8 @@ function encodeTextToQmlRichFormat (text, options) { ...@@ -51,8 +51,8 @@ function encodeTextToQmlRichFormat (text, options) {
var formattedText = execAll(UriTools.URI_REGEX, text, function (str, valid) { var formattedText = execAll(UriTools.URI_REGEX, text, function (str, valid) {
if (!valid) { if (!valid) {
return unscapeHtml(str).replace(/\r\n|\n/g, '<br/>') return unscapeHtml(str).replace(/\r\n|\n/g, '<br/>')
.replace(/\t/g, '&nbsp;&nbsp;&nbsp;&nbsp;') .replace(/\t/g, '&nbsp;&nbsp;&nbsp;&nbsp; ')
.replace(/ /g, '&nbsp;') .replace(/ /g, '&nbsp; ')
} }
var uri = startsWith(str, 'www.') ? 'http://' + str : str 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