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. --- framework/qml/ConversationView.qml | 8 ++++++++ framework/qml/MailListView.qml | 4 ++++ framework/qml/MailViewer.qml | 1 + framework/qml/Messages.qml | 1 + 4 files changed, 14 insertions(+) (limited to 'framework/qml') diff --git a/framework/qml/ConversationView.qml b/framework/qml/ConversationView.qml index 2dab92ba..0fd76f8f 100644 --- a/framework/qml/ConversationView.qml +++ b/framework/qml/ConversationView.qml @@ -31,6 +31,12 @@ FocusScope { property variant mail; property bool hideTrash: true; property bool hideNonTrash: false; + property string searchString: "" + + Kube.Listener { + filter: Kube.Messages.searchString + onMessageReceived: root.searchString = message.searchString + } Rectangle { anchors.fill: parent @@ -46,6 +52,7 @@ FocusScope { left: parent.left right: parent.right } + //Shrink the listview if the content doesn't fill the full height, so the email appears on top instead of on the bottom. height: Math.min(contentHeight, parent.height) @@ -98,6 +105,7 @@ FocusScope { sent: model.sent incomplete: model.incomplete current: delegateRoot.isCurrentItem + searchString: root.searchString } } diff --git a/framework/qml/MailListView.qml b/framework/qml/MailListView.qml index 35c90618..cc68f003 100644 --- a/framework/qml/MailListView.qml +++ b/framework/qml/MailListView.qml @@ -35,6 +35,10 @@ FocusScope { property bool showFilter: false property string filter: null + onFilterChanged: { + Kube.Fabric.postMessage(Kube.Messages.searchString, {"searchString": filter}) + } + onParentFolderChanged: { currentMail = null filterField.clearSearch() diff --git a/framework/qml/MailViewer.qml b/framework/qml/MailViewer.qml index f52e694d..e37fb3f7 100644 --- a/framework/qml/MailViewer.qml +++ b/framework/qml/MailViewer.qml @@ -42,6 +42,7 @@ Rectangle { property bool incomplete: false; property bool current: false; property bool unread; + property alias searchString: mailViewer.searchString implicitHeight: header.height + attachments.height + body.height + incompleteBody.height + footer.height + Kube.Units.largeSpacing diff --git a/framework/qml/Messages.qml b/framework/qml/Messages.qml index 9df83863..35aa750a 100644 --- a/framework/qml/Messages.qml +++ b/framework/qml/Messages.qml @@ -42,6 +42,7 @@ Item { property string progressNotification: "progressNotification" property string errorNotification: "errorNotification" property string search: "search" + property string searchString: "searchString" property string synchronize: "synchronize" property string reply: "reply" property string forward: "forward" -- cgit v1.2.3