diff options
Diffstat (limited to 'components')
-rw-r--r-- | components/kube/contents/ui/Kube.qml | 54 |
1 files changed, 34 insertions, 20 deletions
diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml index 54a81112..92f12f6c 100644 --- a/components/kube/contents/ui/Kube.qml +++ b/components/kube/contents/ui/Kube.qml | |||
@@ -159,7 +159,7 @@ Controls2.ApplicationWindow { | |||
159 | } | 159 | } |
160 | } | 160 | } |
161 | } | 161 | } |
162 | StackView { | 162 | Controls2.StackView { |
163 | id: kubeViews | 163 | id: kubeViews |
164 | 164 | ||
165 | anchors { | 165 | anchors { |
@@ -174,38 +174,52 @@ Controls2.ApplicationWindow { | |||
174 | onMessageReceived: kubeViews.pop({immediate: true}) | 174 | onMessageReceived: kubeViews.pop({immediate: true}) |
175 | } | 175 | } |
176 | 176 | ||
177 | //TODO replacing here while a composer is open is destructive | ||
177 | function setPeopleView() { | 178 | function setPeopleView() { |
178 | //TODO replacing here while a composer is open is destructive | 179 | if (currentItem != peopleView) { |
179 | kubeViews.push({item: peopleView, replace: true, immediate: true}) | 180 | kubeViews.replace(null, peopleView, Controls2.StackView.Immediate) |
181 | } | ||
180 | } | 182 | } |
181 | function setMailView() { | 183 | function setMailView() { |
182 | //TODO replacing here while a composer is open is destructive | 184 | if (currentItem != mailView) { |
183 | kubeViews.push({item: mailView, replace: true, immediate: true}) | 185 | kubeViews.replace(null, mailView, Controls2.StackView.Immediate) |
186 | } | ||
184 | } | 187 | } |
185 | function setAccountsView() { | 188 | function setAccountsView() { |
186 | kubeViews.push({item: accountsView, replace: true, immediate: true}) | 189 | if (currentItem != accountsView) { |
190 | kubeViews.replace(null, accountsView, Controls2.StackView.Immediate) | ||
191 | } | ||
187 | } | 192 | } |
188 | function setLogView() { | 193 | function setLogView() { |
189 | kubeViews.push({item: logView, replace: true, immediate: true}) | 194 | if (currentItem != logView) { |
195 | kubeViews.replace(null, logView, Controls2.StackView.Immediate) | ||
196 | } | ||
190 | } | 197 | } |
191 | 198 | ||
192 | function openComposer(newMessage) { | 199 | function openComposer(newMessage) { |
193 | kubeViews.push({item: composerView, immediate: true, properties: {newMessage: newMessage}}) | 200 | kubeViews.push(composerView, {newMessage: newMessage}, Controls2.StackView.Immediate) |
194 | } | 201 | } |
195 | function openComposerWithMail(mail, openAsDraft) { | 202 | function openComposerWithMail(mail, openAsDraft) { |
196 | kubeViews.push({item: composerView, immediate: true, properties: {message: mail, loadAsDraft: openAsDraft}}) | 203 | kubeViews.push(composerView, {message: mail, loadAsDraft: openAsDraft}, Controls2.StackView.Immediate) |
197 | } | ||
198 | //Not components so we maintain state | ||
199 | MailView { | ||
200 | id: mailView | ||
201 | } | ||
202 | PeopleView { | ||
203 | id: peopleView | ||
204 | } | ||
205 | //Not a component because otherwise we can't log stuff | ||
206 | LogView { | ||
207 | id: logView | ||
208 | } | 204 | } |
205 | |||
206 | //These items are not visible until pushed onto the stack, so we keep them in resources instead of items | ||
207 | resources: [ | ||
208 | //Not components so we maintain state | ||
209 | MailView { | ||
210 | id: mailView | ||
211 | anchors.fill: parent | ||
212 | }, | ||
213 | PeopleView { | ||
214 | id: peopleView | ||
215 | anchors.fill: parent | ||
216 | }, | ||
217 | //Not a component because otherwise we can't log stuff | ||
218 | LogView { | ||
219 | id: logView | ||
220 | anchors.fill: parent | ||
221 | } | ||
222 | ] | ||
209 | //A component so it's always destroyed when we're done | 223 | //A component so it's always destroyed when we're done |
210 | Component { | 224 | Component { |
211 | id: composerView | 225 | id: composerView |