From ec48ea0cf01d306c0a9283e485f8c37d7d4d1ebd Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sun, 16 Apr 2017 22:18:02 +0200 Subject: Hide trash from non-trash conversations. ...and indicate in the conversation view if a mail has been sent or is a draft. --- framework/qml/ConversationView.qml | 18 ++++++++++++++++++ framework/qml/FolderListView.qml | 2 ++ 2 files changed, 20 insertions(+) (limited to 'framework/qml') diff --git a/framework/qml/ConversationView.qml b/framework/qml/ConversationView.qml index 83771925..0d71dde9 100644 --- a/framework/qml/ConversationView.qml +++ b/framework/qml/ConversationView.qml @@ -34,6 +34,9 @@ Rectangle { property int currentIndex: 0; property bool scrollToEnd: true; property variant currentMail: null; + property bool hideTrash: true; + property bool hideNonTrash: false; + onCurrentIndexChanged: { markAsReadTimer.restart(); } @@ -186,6 +189,7 @@ Rectangle { height: sheet.height + Kube.Units.gridUnit width: parent.width + visible: !((root.hideTrash && model.trash) || (root.hideNonTrash && !model.trash)) MouseArea { anchors.fill: parent @@ -321,6 +325,20 @@ Rectangle { color: Kube.Colors.textColor opacity: 0.75 font.italic: true + states: [ + State { + name: "trash"; when: model.trash + PropertyChanges { target: subject; text: "Trash: " + model.subject } + }, + State { + name: "draft"; when: model.draft + PropertyChanges { target: subject; text: "Draft: " + model.subject } + }, + State { + name: "sent"; when: model.sent + PropertyChanges { target: subject; text: "Sent: " + model.subject } + } + ] } Text { diff --git a/framework/qml/FolderListView.qml b/framework/qml/FolderListView.qml index 1455be21..734e6e10 100644 --- a/framework/qml/FolderListView.qml +++ b/framework/qml/FolderListView.qml @@ -29,6 +29,7 @@ Rectangle { property variant currentFolder: null property variant accountId + property bool isTrashFolder: false color: Kube.Colors.textColor @@ -77,6 +78,7 @@ Rectangle { onCurrentIndexChanged: { model.fetchMore(currentIndex) root.currentFolder = model.data(currentIndex, Kube.FolderListModel.DomainObject) + root.isTrashFolder = model.data(currentIndex, Kube.FolderListModel.Trash) folderController.synchronizeAction.execute() } -- cgit v1.2.3