From bc6ac986dc9dde942b0a9185940e748c3a0e87c9 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 1 Jul 2018 10:00:11 +0200 Subject: Enable HTML mode when loading an html message. --- framework/qml/TextEditor.qml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'framework/qml') diff --git a/framework/qml/TextEditor.qml b/framework/qml/TextEditor.qml index e5cc665c..7b1c5dee 100644 --- a/framework/qml/TextEditor.qml +++ b/framework/qml/TextEditor.qml @@ -34,6 +34,7 @@ FocusScope { property string initialText onInitialTextChanged: { + htmlEnabled = document.isHtml(initialText) edit.text = initialText } @@ -55,7 +56,9 @@ FocusScope { document: edit.textDocument selectionStart: edit.selectionStart selectionEnd: edit.selectionEnd - onTextChanged: root.htmlEnabled ? root.text = htmlText : root.text = plainText + onTextChanged: { + root.htmlEnabled ? root.text = htmlText : root.text = plainText + } cursorPosition: edit.cursorPosition } -- cgit v1.2.3