From 0365646737a1894ca6de94e8a9ad9dd6f28e0493 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 12 Feb 2018 21:34:40 +0100 Subject: A basic but working searchview --- views/search/metadata.json | 4 ++-- views/search/qml/View.qml | 57 +++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 53 insertions(+), 8 deletions(-) (limited to 'views/search') diff --git a/views/search/metadata.json b/views/search/metadata.json index 870ff2aa..a3f6d4a5 100644 --- a/views/search/metadata.json +++ b/views/search/metadata.json @@ -1,4 +1,4 @@ { - "icon": "mail-message-inverted", - "tooltip": "Follow conversations." + "icon": "edit-find-inverted", + "tooltip": "Search" } diff --git a/views/search/qml/View.qml b/views/search/qml/View.qml index d2c8ae65..437b0ba2 100644 --- a/views/search/qml/View.qml +++ b/views/search/qml/View.qml @@ -26,14 +26,59 @@ import QtQuick.Layouts 1.1 import org.kube.framework 1.0 as Kube FocusScope { - Rectangle { + SplitView { anchors.fill: parent - Kube.MailListView { - id: mailListView - anchors.fill: parent - activeFocusOnTab: true + ColumnLayout { + width: Kube.Units.gridUnit * 18 Layout.minimumWidth: Kube.Units.gridUnit * 10 + Rectangle { + id: filterField + Layout.fillWidth: true + height: Kube.Units.gridUnit * 2 + color: Kube.Colors.textColor + + function clearSearch() { + find.text = "" + mailListView.filter = "" + } + + RowLayout { + anchors { + verticalCenter: parent.verticalCenter + } + + width: parent.width - Kube.Units.smallSpacing + spacing: 0 + + Kube.IconButton { + iconName: Kube.Icons.remove + onClicked: filterField.clearSearch() + } + + Kube.TextField { + id: find + Layout.fillWidth: true + placeholderText: qsTr("Search...") + onTextChanged: mailListView.filter = text + focus: true + Keys.onEscapePressed: filterField.clearSearch() + } + } + } + Kube.MailListView { + id: mailListView + showFilter: false + Layout.fillWidth: true + Layout.fillHeight: true + } + } + Kube.ConversationView { + id: mailView + objectName: "mailView" + Layout.fillWidth: true + Layout.fillHeight: parent.height + activeFocusOnTab: true + mail: mailListView.currentMail } - } } } -- cgit v1.2.3