From e14b89a7c70cfdcccd053581752af19f9fc80776 Mon Sep 17 00:00:00 2001 From: Marco Martin Date: Tue, 19 Feb 2013 17:27:04 +0100 Subject: [PATCH] start to delay a bit objects creation. use a component incubator to create objects whuile the event loop is running load applets ui only when they get a view it will have to be cleaned out a lot, by moving the loading logic into AppletInterface --- containments/testpanel/contents/ui/main.qml | 22 +++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/containments/testpanel/contents/ui/main.qml b/containments/testpanel/contents/ui/main.qml index be36ebe34..6166387b1 100644 --- a/containments/testpanel/contents/ui/main.qml +++ b/containments/testpanel/contents/ui/main.qml @@ -21,7 +21,8 @@ import QtQuick 2.0 import org.kde.plasma.core 0.1 as PlasmaCore import org.kde.plasma.components 0.1 as PlasmaComponents -Row { + +Item { id: root width: 640 height: 48 @@ -31,13 +32,13 @@ Row { Connections { target: plasmoid onAppletAdded: { - var container = appletContainerComponent.createObject(root) - container.visible = true + var container = appletContainerComponent.createObject(row) print("Applet added in test panel: " + applet) applet.parent = container container.applet = applet - applet.anchors.fill= applet.parent + applet.anchors.fill = applet.parent applet.visible = true + container.visible = true } } @@ -45,12 +46,13 @@ Row { id: appletContainerComponent Item { id: container + visible: false anchors { top: parent.top bottom: parent.bottom } - width: height + width: height property Item applet @@ -64,8 +66,16 @@ Row { } } + Row { + id: row + anchors { + top: parent.top + bottom: parent.bottom + } + } + Component.onCompleted: { print("Test Panel loaded") print(plasmoid) } -} \ No newline at end of file +}