From 680fd8bed732fcafd98ae1c410ba5473e38d18c1 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 12 Mar 2016 12:30:08 +0100 Subject: Dynamically create components instead of just hiding them --- components/mail/contents/ui/main.qml | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) (limited to 'components/mail') diff --git a/components/mail/contents/ui/main.qml b/components/mail/contents/ui/main.qml index d864f2fc..83bd85b2 100644 --- a/components/mail/contents/ui/main.qml +++ b/components/mail/contents/ui/main.qml @@ -74,7 +74,14 @@ ApplicationWindow { height: parent.height text: "Settings" onClicked: { - settings.visible = true + settingsComponent.createObject(app) + } + Component { + id: settingsComponent + KubeComponents.Settings { + id: settings + anchors.fill: parent + } } } @@ -83,7 +90,7 @@ ApplicationWindow { iconName: "mail-message-new" text: "Compose" onClicked: { - composer.visible = true + composerComponent.createObject(app) } } @@ -92,8 +99,15 @@ ApplicationWindow { iconName: "mail-message-reply" text: "Reply" onClicked: { + composerComponent.createObject(app) composer.originalMessage = mailListView.currentMail - composer.visible = true + } + } + Component { + id: composerComponent + KubeComponents.FocusComposer { + id: composer + anchors.fill: parent } } @@ -177,16 +191,5 @@ ApplicationWindow { } - KubeComponents.Settings { - id: settings - - anchors.fill: parent - } - - KubeComponents.FocusComposer { - id: composer - - anchors.fill: parent - } } -- cgit v1.2.3