diff options
-rw-r--r-- | components/mail/contents/ui/main.qml | 2 | ||||
-rw-r--r-- | components/package/contents/ui/AccountSwitcher.qml | 17 | ||||
-rw-r--r-- | components/package/contents/ui/FolderListView.qml | 5 |
3 files changed, 22 insertions, 2 deletions
diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml index 5fe8581f..252cac5b 100644 --- a/components/mail/contents/ui/main.qml +++ b/components/mail/contents/ui/main.qml | |||
@@ -138,6 +138,7 @@ Controls2.ApplicationWindow { | |||
138 | Layout.maximumWidth: app.width * 0.25 | 138 | Layout.maximumWidth: app.width * 0.25 |
139 | Layout.minimumWidth: Kirigami.Units.gridUnit * 5 | 139 | Layout.minimumWidth: Kirigami.Units.gridUnit * 5 |
140 | focus: true | 140 | focus: true |
141 | accountId: accountSwitcher.accountId | ||
141 | } | 142 | } |
142 | 143 | ||
143 | KubeComponents.MailListView { | 144 | KubeComponents.MailListView { |
@@ -181,6 +182,7 @@ Controls2.ApplicationWindow { | |||
181 | width: folderListView.width - 5 //to adjust for the toolbar spacing | 182 | width: folderListView.width - 5 //to adjust for the toolbar spacing |
182 | 183 | ||
183 | KubeComponents.AccountSwitcher { | 184 | KubeComponents.AccountSwitcher { |
185 | id: accountSwitcher | ||
184 | } | 186 | } |
185 | } | 187 | } |
186 | //END Folderlist section | 188 | //END Folderlist section |
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) |