diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-05 11:05:40 +0100 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-01-05 11:05:40 +0100 |
commit | 303248a7da2e671f69aa1a7308a1625492c3459b (patch) | |
tree | b5d17efd538d674c6af6a522583f06f31919231c /components/package/contents | |
parent | 7d8b069fb61cff1f5dc3206c31cd9c6664d39dc5 (diff) | |
download | kube-303248a7da2e671f69aa1a7308a1625492c3459b.tar.gz kube-303248a7da2e671f69aa1a7308a1625492c3459b.zip |
Filter folders by account
Diffstat (limited to 'components/package/contents')
-rw-r--r-- | components/package/contents/ui/AccountSwitcher.qml | 17 | ||||
-rw-r--r-- | components/package/contents/ui/FolderListView.qml | 5 |
2 files changed, 20 insertions, 2 deletions
diff --git a/components/package/contents/ui/AccountSwitcher.qml b/components/package/contents/ui/AccountSwitcher.qml index e9e9b549..6c899c50 100644 --- a/components/package/contents/ui/AccountSwitcher.qml +++ b/components/package/contents/ui/AccountSwitcher.qml | |||
@@ -19,6 +19,7 @@ | |||
19 | import QtQuick 2.4 | 19 | import QtQuick 2.4 |
20 | import QtQuick.Layouts 1.1 | 20 | import QtQuick.Layouts 1.1 |
21 | import QtQuick.Controls 2.0 as Controls2 | 21 | import QtQuick.Controls 2.0 as Controls2 |
22 | import QtQml 2.2 as QtQml | ||
22 | 23 | ||
23 | import org.kde.kirigami 1.0 as Kirigami | 24 | import org.kde.kirigami 1.0 as Kirigami |
24 | 25 | ||
@@ -28,6 +29,8 @@ import org.kube.components 1.0 as KubeComponents | |||
28 | Controls2.Button { | 29 | Controls2.Button { |
29 | id: accountSwitcher | 30 | id: accountSwitcher |
30 | 31 | ||
32 | property variant accountId | ||
33 | |||
31 | KubeFramework.FolderController { | 34 | KubeFramework.FolderController { |
32 | id: folderController | 35 | id: folderController |
33 | } | 36 | } |
@@ -130,10 +133,22 @@ Controls2.Button { | |||
130 | enabled: true | 133 | enabled: true |
131 | supportsMouseEvents: true | 134 | supportsMouseEvents: true |
132 | 135 | ||
133 | contentItem: Item { | 136 | checked: listView.currentIndex == index |
137 | onClicked: { | ||
138 | listView.currentIndex = model.index | ||
139 | popup.close() | ||
140 | } | ||
141 | Item { | ||
134 | height: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing * 1 | 142 | height: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing * 1 |
135 | width: listView.width | 143 | width: listView.width |
136 | 144 | ||
145 | QtQml.Binding { | ||
146 | target: accountSwitcher | ||
147 | property: "accountId" | ||
148 | when: listView.currentIndex == index | ||
149 | value: model.accountId | ||
150 | } | ||
151 | |||
137 | RowLayout { | 152 | RowLayout { |
138 | anchors { | 153 | anchors { |
139 | verticalCenter: parent.verticalCenter | 154 | verticalCenter: parent.verticalCenter |
diff --git a/components/package/contents/ui/FolderListView.qml b/components/package/contents/ui/FolderListView.qml index f90a0711..6646d88f 100644 --- a/components/package/contents/ui/FolderListView.qml +++ b/components/package/contents/ui/FolderListView.qml | |||
@@ -49,7 +49,10 @@ Rectangle { | |||
49 | role: "name" | 49 | role: "name" |
50 | } | 50 | } |
51 | 51 | ||
52 | model: KubeFramework.FolderListModel { id: folderListModel} //; accountId: wrapper.accountId } | 52 | model: KubeFramework.FolderListModel { |
53 | id: folderListModel | ||
54 | accountId: root.accountId | ||
55 | } | ||
53 | 56 | ||
54 | onCurrentIndexChanged: { | 57 | onCurrentIndexChanged: { |
55 | model.fetchMore(currentIndex) | 58 | model.fetchMore(currentIndex) |