diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-04-17 23:13:41 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2018-04-17 23:13:41 +0200 |
commit | 0ad2650fd4084c7c7518b80d0f2d3f1275d89f28 (patch) | |
tree | bc6b08c002cf3a9280500a8820e258ac0ce2a975 | |
parent | 8bac76742270829a0e8753eb53a1cc7384dda323 (diff) | |
download | kube-0ad2650fd4084c7c7518b80d0f2d3f1275d89f28.tar.gz kube-0ad2650fd4084c7c7518b80d0f2d3f1275d89f28.zip |
Always select the first index (INBOX) in the folderlist initially.
-rw-r--r-- | framework/qml/FolderListView.qml | 6 | ||||
-rw-r--r-- | framework/qml/InlineAccountSwitcher.qml | 12 | ||||
-rw-r--r-- | framework/qml/TreeView.qml | 5 | ||||
-rw-r--r-- | views/conversation/main.qml | 26 |
4 files changed, 39 insertions, 10 deletions
diff --git a/framework/qml/FolderListView.qml b/framework/qml/FolderListView.qml index 221ec31c..bf1f52e5 100644 --- a/framework/qml/FolderListView.qml +++ b/framework/qml/FolderListView.qml | |||
@@ -74,10 +74,4 @@ Kube.TreeView { | |||
74 | accountId: root.accountId | 74 | accountId: root.accountId |
75 | } | 75 | } |
76 | 76 | ||
77 | onActivated: { | ||
78 | //TODO do some event compression in case of double clicks | ||
79 | model.fetchMore(index); | ||
80 | Kube.Fabric.postMessage(Kube.Messages.folderSelection, {"folder": model.data(index, Kube.FolderListModel.DomainObject), | ||
81 | "trash": model.data(index, Kube.FolderListModel.Trash)}); | ||
82 | } | ||
83 | } | 77 | } |
diff --git a/framework/qml/InlineAccountSwitcher.qml b/framework/qml/InlineAccountSwitcher.qml index b7f69588..2af1a455 100644 --- a/framework/qml/InlineAccountSwitcher.qml +++ b/framework/qml/InlineAccountSwitcher.qml | |||
@@ -86,6 +86,18 @@ FocusScope { | |||
86 | 86 | ||
87 | accountId: currentData.accountId | 87 | accountId: currentData.accountId |
88 | visible: isCurrent | 88 | visible: isCurrent |
89 | onVisibleChanged: { | ||
90 | if (visible) { | ||
91 | selectRootIndex() | ||
92 | } | ||
93 | } | ||
94 | |||
95 | onActivated: { | ||
96 | if (visible) { | ||
97 | Kube.Fabric.postMessage(Kube.Messages.folderSelection, {"folder": model.data(index, Kube.FolderListModel.DomainObject), | ||
98 | "trash": model.data(index, Kube.FolderListModel.Trash)}); | ||
99 | } | ||
100 | } | ||
89 | } | 101 | } |
90 | } | 102 | } |
91 | } | 103 | } |
diff --git a/framework/qml/TreeView.qml b/framework/qml/TreeView.qml index d7fed711..ec249eb9 100644 --- a/framework/qml/TreeView.qml +++ b/framework/qml/TreeView.qml | |||
@@ -58,6 +58,11 @@ FocusScope { | |||
58 | activated(treeView.selection.currentIndex) | 58 | activated(treeView.selection.currentIndex) |
59 | } | 59 | } |
60 | 60 | ||
61 | function selectRootIndex() { | ||
62 | treeView.selection.setCurrentIndex(model.index(0, 0), ItemSelectionModel.ClearAndSelect) | ||
63 | activated(treeView.selection.currentIndex) | ||
64 | } | ||
65 | |||
61 | Flickable { | 66 | Flickable { |
62 | id: flickableItem | 67 | id: flickableItem |
63 | 68 | ||
diff --git a/views/conversation/main.qml b/views/conversation/main.qml index cb42fe5c..f2d28d26 100644 --- a/views/conversation/main.qml +++ b/views/conversation/main.qml | |||
@@ -34,12 +34,18 @@ ApplicationWindow { | |||
34 | accounts: [{ | 34 | accounts: [{ |
35 | id: "account1", | 35 | id: "account1", |
36 | name: "Test Account" | 36 | name: "Test Account" |
37 | }], | 37 | }, |
38 | { | ||
39 | id: "account2", | ||
40 | name: "Test Account2" | ||
41 | } | ||
42 | ], | ||
38 | identities: [{ | 43 | identities: [{ |
39 | account: "account1", | 44 | account: "account1", |
40 | name: "Test Identity", | 45 | name: "Test Identity", |
41 | address: "identity@example.org" | 46 | address: "identity@example.org" |
42 | }], | 47 | } |
48 | ], | ||
43 | resources: [{ | 49 | resources: [{ |
44 | id: "resource1", | 50 | id: "resource1", |
45 | account: "account1", | 51 | account: "account1", |
@@ -49,7 +55,13 @@ ApplicationWindow { | |||
49 | id: "resource2", | 55 | id: "resource2", |
50 | account: "account1", | 56 | account: "account1", |
51 | type: "mailtransport" | 57 | type: "mailtransport" |
52 | }], | 58 | }, |
59 | { | ||
60 | id: "resource3", | ||
61 | account: "account2", | ||
62 | type: "dummy" | ||
63 | } | ||
64 | ], | ||
53 | folders: [{ | 65 | folders: [{ |
54 | id: "folder1", | 66 | id: "folder1", |
55 | resource: "resource1", | 67 | resource: "resource1", |
@@ -203,7 +215,13 @@ Bvr+rojxTJ3X+pzb2LJQwJnALL/VdIF3yHtGu2//Yfu4oxGGA0M90KiW | |||
203 | ], | 215 | ], |
204 | }, | 216 | }, |
205 | ] | 217 | ] |
206 | }], | 218 | }, |
219 | { | ||
220 | id: "folder2", | ||
221 | resource: "resource1", | ||
222 | name: "Folder 2" | ||
223 | } | ||
224 | ], | ||
207 | } | 225 | } |
208 | TestStore.setup(initialState) | 226 | TestStore.setup(initialState) |
209 | } | 227 | } |