diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-03-02 12:00:54 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-03-02 12:03:04 +0100 |
commit | 03e8aabf1754f5061f207d2c9c082ba6199db0e5 (patch) | |
tree | 66124163b4da541dfb17c30299b9aeb82f9fad79 /framework/qml/FolderListView.qml | |
parent | 795d551639340d81641aa8c6eabff1776e0b2ee1 (diff) | |
download | kube-03e8aabf1754f5061f207d2c9c082ba6199db0e5.tar.gz kube-03e8aabf1754f5061f207d2c9c082ba6199db0e5.zip |
Visualize that a folder has new mails.
We listen for new mail notifications, and highlight the folder
accordingly.
Diffstat (limited to 'framework/qml/FolderListView.qml')
-rw-r--r-- | framework/qml/FolderListView.qml | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/framework/qml/FolderListView.qml b/framework/qml/FolderListView.qml index 25c6cbe5..a24a9ff6 100644 --- a/framework/qml/FolderListView.qml +++ b/framework/qml/FolderListView.qml | |||
@@ -30,6 +30,33 @@ Kube.TreeView { | |||
30 | Controls1.TableViewColumn { | 30 | Controls1.TableViewColumn { |
31 | title: "Name" | 31 | title: "Name" |
32 | role: "name" | 32 | role: "name" |
33 | delegate: Item { | ||
34 | DropArea { | ||
35 | anchors.fill: parent | ||
36 | Rectangle { | ||
37 | anchors.fill: parent | ||
38 | color: Kube.Colors.viewBackgroundColor | ||
39 | opacity: 0.3 | ||
40 | visible: parent.containsDrag | ||
41 | } | ||
42 | onDropped: { | ||
43 | Kube.Fabric.postMessage(Kube.Messages.moveToFolder, {"mail": drop.source.mail, "folder": model.domainObject}) | ||
44 | drop.accept(Qt.MoveAction) | ||
45 | drop.source.visible = false | ||
46 | } | ||
47 | } | ||
48 | |||
49 | Kube.Label { | ||
50 | anchors { | ||
51 | verticalCenter: parent.verticalCenter | ||
52 | left: parent.left | ||
53 | right: parent.right | ||
54 | } | ||
55 | text: styleData.value | ||
56 | elide: Qt.ElideRight | ||
57 | color: model.hasNewData ? Kube.Colors.highlightColor : Kube.Colors.viewBackgroundColor | ||
58 | } | ||
59 | } | ||
33 | } | 60 | } |
34 | 61 | ||
35 | model: Kube.FolderListModel { | 62 | model: Kube.FolderListModel { |
@@ -43,11 +70,4 @@ Kube.TreeView { | |||
43 | Kube.Fabric.postMessage(Kube.Messages.folderSelection, {"folder": model.data(index, Kube.FolderListModel.DomainObject), | 70 | Kube.Fabric.postMessage(Kube.Messages.folderSelection, {"folder": model.data(index, Kube.FolderListModel.DomainObject), |
44 | "trash": model.data(index, Kube.FolderListModel.Trash)}); | 71 | "trash": model.data(index, Kube.FolderListModel.Trash)}); |
45 | } | 72 | } |
46 | |||
47 | |||
48 | onDropped: { | ||
49 | Kube.Fabric.postMessage(Kube.Messages.moveToFolder, {"mail": drop.source.mail, "folder": model.domainObject}) | ||
50 | drop.accept(Qt.MoveAction) | ||
51 | drop.source.visible = false | ||
52 | } | ||
53 | } | 73 | } |