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. 22
      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)
}
}
}

Loading…
Cancel
Save