summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2017-08-22 21:21:37 -0600
committerChristian Mollekopf <chrigi_1@fastmail.fm>2017-08-22 21:21:37 -0600
commit283fd009b4469a27bee6fbd96a336e291da52bc3 (patch)
tree71157feec3032d0f96f319f367d58f2e6939f79b
parentc85ff141ae65ef7cb7d593bc031f80e0a99806b8 (diff)
downloadkube-283fd009b4469a27bee6fbd96a336e291da52bc3.tar.gz
kube-283fd009b4469a27bee6fbd96a336e291da52bc3.zip
React to the activated signal instead
That works also when popping of elements
-rw-r--r--components/kube/contents/ui/Kube.qml11
1 files changed, 5 insertions, 6 deletions
diff --git a/components/kube/contents/ui/Kube.qml b/components/kube/contents/ui/Kube.qml
index 518b0c9c..d6f63679 100644
--- a/components/kube/contents/ui/Kube.qml
+++ b/components/kube/contents/ui/Kube.qml
@@ -217,34 +217,28 @@ Controls2.ApplicationWindow {
217 217
218 //TODO replacing here while a composer is open is destructive 218 //TODO replacing here while a composer is open is destructive
219 function setPeopleView() { 219 function setPeopleView() {
220 peopleButton.checked = true
221 if (currentItem != peopleView) { 220 if (currentItem != peopleView) {
222 kubeViews.replace(null, peopleView, Controls2.StackView.Immediate) 221 kubeViews.replace(null, peopleView, Controls2.StackView.Immediate)
223 } 222 }
224 } 223 }
225 function setMailView() { 224 function setMailView() {
226 mailButton.checked = true
227 if (currentItem != mailView) { 225 if (currentItem != mailView) {
228 kubeViews.replace(null, mailView, Controls2.StackView.Immediate) 226 kubeViews.replace(null, mailView, Controls2.StackView.Immediate)
229 } 227 }
230 } 228 }
231 function setAccountsView() { 229 function setAccountsView() {
232 accountsButton.checked = true
233 kubeViews.push(accountsView, {}, Controls2.StackView.Immediate) 230 kubeViews.push(accountsView, {}, Controls2.StackView.Immediate)
234 } 231 }
235 function setLogView() { 232 function setLogView() {
236 logButton.checked = true
237 if (currentItem != logView) { 233 if (currentItem != logView) {
238 kubeViews.replace(null, logView, Controls2.StackView.Immediate) 234 kubeViews.replace(null, logView, Controls2.StackView.Immediate)
239 } 235 }
240 } 236 }
241 237
242 function openComposer(newMessage, recipients) { 238 function openComposer(newMessage, recipients) {
243 composerButton.checked = true
244 kubeViews.push(composerView, {newMessage: newMessage, recipients: recipients}, Controls2.StackView.Immediate) 239 kubeViews.push(composerView, {newMessage: newMessage, recipients: recipients}, Controls2.StackView.Immediate)
245 } 240 }
246 function openComposerWithMail(mail, openAsDraft) { 241 function openComposerWithMail(mail, openAsDraft) {
247 composerButton.checked = true
248 kubeViews.push(composerView, {message: mail, loadAsDraft: openAsDraft}, Controls2.StackView.Immediate) 242 kubeViews.push(composerView, {message: mail, loadAsDraft: openAsDraft}, Controls2.StackView.Immediate)
249 } 243 }
250 244
@@ -264,15 +258,18 @@ Controls2.ApplicationWindow {
264 MailView { 258 MailView {
265 id: mailView 259 id: mailView
266 anchors.fill: parent 260 anchors.fill: parent
261 Controls2.StackView.onActivated: mailButton.checked = true
267 }, 262 },
268 PeopleView { 263 PeopleView {
269 id: peopleView 264 id: peopleView
270 anchors.fill: parent 265 anchors.fill: parent
266 Controls2.StackView.onActivated: peopleButton.checked = true
271 }, 267 },
272 //Not a component because otherwise we can't log stuff 268 //Not a component because otherwise we can't log stuff
273 LogView { 269 LogView {
274 id: logView 270 id: logView
275 anchors.fill: parent 271 anchors.fill: parent
272 Controls2.StackView.onActivated: logButton.checked = true
276 } 273 }
277 ] 274 ]
278 //A component so it's always destroyed when we're done 275 //A component so it's always destroyed when we're done
@@ -280,12 +277,14 @@ Controls2.ApplicationWindow {
280 id: composerView 277 id: composerView
281 ComposerView { 278 ComposerView {
282 anchors.fill: parent 279 anchors.fill: parent
280 Controls2.StackView.onActivated: composerButton.checked = true
283 } 281 }
284 } 282 }
285 Component { 283 Component {
286 id: accountsView 284 id: accountsView
287 AccountsView { 285 AccountsView {
288 anchors.fill: parent 286 anchors.fill: parent
287 Controls2.StackView.onActivated: accountsButton.checked = true
289 } 288 }
290 } 289 }
291 } 290 }