| 1 |
/* |
| 2 |
SPDX-FileCopyrightText: 2013 Marco Martin <[email protected]> |
| 3 |
|
| 4 |
SPDX-License-Identifier: GPL-2.0-or-later |
| 5 |
*/ |
| 6 |
|
| 7 |
import QtQuick |
| 8 |
|
| 9 |
import org.kde.plasma.components as PlasmaComponents |
| 10 |
import org.kde.plasma.plasmoid |
| 11 |
|
| 12 |
Item { |
| 13 |
id: root |
| 14 |
width: 640 |
| 15 |
height: 480 |
| 16 |
|
| 17 |
property Item toolBox |
| 18 |
|
| 19 |
function addApplet(applet, x, y) { |
| 20 |
var component = Qt.createComponent("PlasmoidContainer.qml") |
| 21 |
var plasmoidContainer = component.createObject(root, {"x": x, "y": y}); |
| 22 |
|
| 23 |
plasmoidContainer.parent = root; |
| 24 |
plasmoidContainer.applet = applet |
| 25 |
applet.parent = plasmoidContainer |
| 26 |
applet.anchors.fill = plasmoidContainer |
| 27 |
applet.visible = true |
| 28 |
plasmoidContainer.visible = true |
| 29 |
|
| 30 |
} |
| 31 |
|
| 32 |
Containment.onAppletAdded: { |
| 33 |
addApplet(applet, x, y); |
| 34 |
} |
| 35 |
|
| 36 |
Component.onCompleted: { |
| 37 |
print("Test Containment loaded") |
| 38 |
print(plasmoid) |
| 39 |
} |
| 40 |
} |