Commit 737c52aa authored by Ronan Abhamon's avatar Ronan Abhamon

feat(Chat): supports text selection

parent 51b629c4
...@@ -162,7 +162,7 @@ ColumnLayout { ...@@ -162,7 +162,7 @@ ColumnLayout {
// TMP // TMP
model: ListModel { model: ListModel {
ListElement { $dateSection: 1465389121000; $outgoing: true; $timestamp: 1465389121000; $type: 'message'; $content: "<img src='http://html.com/wp-content/uploads/html-com-1.png' width='50%' height='50%' />www.google.fr" } ListElement { $dateSection: 1465389121000; $outgoing: true; $timestamp: 1465389121000; $type: 'message'; $content: "https://cdn.pixabay.com/photo/2014/03/29/09/17/cat-300572_960_720.jpg <img src='http://html.com/wp-content/uploads/html-com-1.png' width='50%' height='50%' />www.google.fr" }
ListElement { $dateSection: 1465389121000; $outgoing: true; $timestamp: 1465389121000; $type: 'message'; $content: "<a href='mailto:qq1@qqpart.com'>Contact mail</a>" } ListElement { $dateSection: 1465389121000; $outgoing: true; $timestamp: 1465389121000; $type: 'message'; $content: "<a href='mailto:qq1@qqpart.com'>Contact mail</a>" }
ListElement { $dateSection: 1465389121000; $timestamp: 1465389133000; $type: 'event'; $content: 'incoming_call' } ListElement { $dateSection: 1465389121000; $timestamp: 1465389133000; $type: 'event'; $content: 'incoming_call' }
ListElement { $dateSection: 1465389121000; $timestamp: 1465389439000; $type: 'message'; $content: 'www.test.fr<blink>Perfect!</blink> bg g vg gv v g v hgv gv gv jhb jh b jb jh hg vg cfcy f v u uyg f tf tf ft f tf t t fy ft f tu ty f rd rd d d uu gu y gg y f r dr ' } ListElement { $dateSection: 1465389121000; $timestamp: 1465389439000; $type: 'message'; $content: 'www.test.fr<blink>Perfect!</blink> bg g vg gv v g v hgv gv gv jhb jh b jb jh hg vg cfcy f v u uyg f tf tf ft f tf t t fy ft f tu ty f rd rd d d uu gu y gg y f r dr ' }
......
...@@ -29,7 +29,7 @@ Item { ...@@ -29,7 +29,7 @@ Item {
) + text.padding * 2 ) + text.padding * 2
} }
Text { TextEdit {
id: text id: text
anchors { anchors {
...@@ -37,12 +37,11 @@ Item { ...@@ -37,12 +37,11 @@ Item {
right: container.right right: container.right
} }
padding: ChatStyle.entry.message.padding padding: ChatStyle.entry.message.padding
readOnly: true
selectByMouse: true
text: Utils.encodeUrisToQmlFormat($content) text: Utils.encodeUrisToQmlFormat($content)
wrapMode: Text.Wrap wrapMode: Text.Wrap
// Little fix. Text may disappear with scrolling.
renderType: Text.NativeRendering
// 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 textFormat: Text.RichText
......
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