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
wilder-5.14
Marco Martin 13 years ago
parent 9dbafc0673
commit e14b89a7c7
  1. 16
      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.core 0.1 as PlasmaCore
import org.kde.plasma.components 0.1 as PlasmaComponents import org.kde.plasma.components 0.1 as PlasmaComponents
Row {
Item {
id: root id: root
width: 640 width: 640
height: 48 height: 48
@ -31,13 +32,13 @@ Row {
Connections { Connections {
target: plasmoid target: plasmoid
onAppletAdded: { onAppletAdded: {
var container = appletContainerComponent.createObject(root) var container = appletContainerComponent.createObject(row)
container.visible = true
print("Applet added in test panel: " + applet) print("Applet added in test panel: " + applet)
applet.parent = container applet.parent = container
container.applet = applet container.applet = applet
applet.anchors.fill = applet.parent applet.anchors.fill = applet.parent
applet.visible = true applet.visible = true
container.visible = true
} }
} }
@ -45,6 +46,7 @@ Row {
id: appletContainerComponent id: appletContainerComponent
Item { Item {
id: container id: container
visible: false
anchors { anchors {
top: parent.top top: parent.top
@ -64,6 +66,14 @@ Row {
} }
} }
Row {
id: row
anchors {
top: parent.top
bottom: parent.bottom
}
}
Component.onCompleted: { Component.onCompleted: {
print("Test Panel loaded") print("Test Panel loaded")
print(plasmoid) print(plasmoid)

Loading…
Cancel
Save