support for vertical panels

This commit is contained in:
Marco Martin 2013-02-22 11:49:31 +01:00
parent 06ca6e57aa
commit b29ddd2f27

View File

@ -32,7 +32,7 @@ Item {
Connections { Connections {
target: plasmoid target: plasmoid
onAppletAdded: { onAppletAdded: {
var container = appletContainerComponent.createObject(row) var container = appletContainerComponent.createObject((plasmoid.formFactor == 3) ? column : row)
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
@ -40,6 +40,17 @@ Item {
applet.visible = true applet.visible = true
container.visible = true container.visible = true
} }
onFormFactorChanged: {
if (plasmoid.formFactor == 3) {
for (var container in row.children) {
container.parent = column
}
} else {
for (var container in column.children) {
container.parent = row
}
}
}
} }
Component { Component {
@ -48,11 +59,8 @@ Item {
id: container id: container
visible: false visible: false
anchors { width: Math.min(root.width, root.height)
top: parent.top height: width
bottom: parent.bottom
}
width: height
property Item applet property Item applet
@ -71,6 +79,15 @@ Item {
anchors { anchors {
top: parent.top top: parent.top
bottom: parent.bottom bottom: parent.bottom
left: parent.left
}
}
Column {
id: column
anchors {
top: parent.top
left: parent.left
right: parent.right
} }
} }