summaryrefslogtreecommitdiffstats
path: root/framework
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-04-17 23:13:41 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-04-17 23:13:41 +0200
commit0ad2650fd4084c7c7518b80d0f2d3f1275d89f28 (patch)
treebc6b08c002cf3a9280500a8820e258ac0ce2a975 /framework
parent8bac76742270829a0e8753eb53a1cc7384dda323 (diff)
downloadkube-0ad2650fd4084c7c7518b80d0f2d3f1275d89f28.tar.gz
kube-0ad2650fd4084c7c7518b80d0f2d3f1275d89f28.zip
Always select the first index (INBOX) in the folderlist initially.
Diffstat (limited to 'framework')
-rw-r--r--framework/qml/FolderListView.qml6
-rw-r--r--framework/qml/InlineAccountSwitcher.qml12
-rw-r--r--framework/qml/TreeView.qml5
3 files changed, 17 insertions, 6 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