From 7fbd3cbdadb5bfb509b9bc396d949fe38a067072 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Wed, 21 Feb 2018 13:35:11 +0100 Subject: Search in conversationview ...via syntax highligher or search api. --- components/mailviewer/qml/TextContent.qml | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'components/mailviewer/qml/TextContent.qml') diff --git a/components/mailviewer/qml/TextContent.qml b/components/mailviewer/qml/TextContent.qml index 316786ef..95e196b4 100644 --- a/components/mailviewer/qml/TextContent.qml +++ b/components/mailviewer/qml/TextContent.qml @@ -27,8 +27,14 @@ Item { property bool embedded: true property string type + property string searchString property int contentHeight: textEdit.height + onSearchStringChanged: { + //This is a workaround because otherwise the view will not take the ViewHighlighter changes into account. + textEdit.text = root.content + } + TextEdit { id: textEdit @@ -56,5 +62,9 @@ Item { acceptedButtons: Qt.NoButton // we don't want to eat clicks on the Text cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor } + Kube.ViewHighlighter { + textDocument: textEdit.textDocument + searchString: root.searchString + } } } -- cgit v1.2.3