Verified Commit 9e836642 authored by ivan tkachenko's avatar ivan tkachenko
Browse files

[desktoppackage] Replace parent reference with direct access by id

parent 86a4c743
......@@ -80,11 +80,11 @@ PlasmaCore.FrameSvgItem {
var size = dialogRoot.vertical ? height : width
switch(panel.alignment){
case Qt.AlignLeft:
return -size / 2
return -size / 2
case Qt.AlignRight:
return leftMaximumLengthHandle.value - size / 2
return leftMaximumLengthHandle.value - size / 2
default:
return panel.maximumLength / 2 - size / 2
return panel.maximumLength / 2 - size / 2
}
}
//Needed for the same reason as above
......@@ -93,11 +93,11 @@ PlasmaCore.FrameSvgItem {
var dialogRootSize = dialogRoot.vertical ? dialogRoot.height : dialogRoot.width
switch(panel.alignment){
case Qt.AlignLeft:
return dialogRootSize - rightMaximumLengthHandle.value - size / 2
return dialogRootSize - rightMaximumLengthHandle.value - size / 2
case Qt.AlignRight:
return dialogRootSize - size / 2
return dialogRootSize - size / 2
default:
return dialogRootSize - panel.maximumLength / 2 - size / 2
return dialogRootSize - panel.maximumLength / 2 - size / 2
}
}
}
......
......@@ -120,17 +120,17 @@ PlasmaCore.SvgItem {
}
if (dialogRoot.vertical) {
if (root.alignment === Qt.AlignRight) {
root.value = root.parent.height - (parent.y + offset + root.height/2)
root.value = root.parent.height - (root.y + offset + root.height/2)
} else if (alignment === Qt.AlignLeft) {
root.value = parent.y - offset + root.height/2
root.value = root.y - offset + root.height/2
//Center
} else {
if (root.alignment & Qt.AlignRight) {
root.value = (root.parent.height/2 - parent.y + offset)*2 - root.height
root.value = (root.parent.height/2 - root.y + offset)*2 - root.height
} else if (root.alignment & Qt.AlignLeft) {
root.value = (parent.y - offset - root.parent.height/2)*2 + root.height
root.value = (root.y - offset - root.parent.height/2)*2 + root.height
} else {
var value = parent.y - root.parent.height/2 - offset + root.height/2
var value = root.y - root.parent.height/2 - offset + root.height/2
//Snap
if (Math.abs(value) < 5) {
root.value = 0
......@@ -141,17 +141,17 @@ PlasmaCore.SvgItem {
}
} else {
if (root.alignment === Qt.AlignRight) {
root.value = root.parent.width - (parent.x + offset + root.width/2)
root.value = root.parent.width - (root.x + offset + root.width/2)
} else if (alignment === Qt.AlignLeft) {
root.value = parent.x - offset + root.width/2
root.value = root.x - offset + root.width/2
//Center
} else {
if (root.alignment & Qt.AlignRight) {
root.value = (root.parent.width/2 - parent.x + offset)*2 - root.width
root.value = (root.parent.width/2 - root.x + offset)*2 - root.width
} else if (root.alignment & Qt.AlignLeft) {
root.value = (parent.x - offset - root.parent.width/2)*2 + root.width
root.value = (root.x - offset - root.parent.width/2)*2 + root.width
} else {
var value = parent.x - root.parent.width/2 - offset + root.width/2
var value = root.x - root.parent.width/2 - offset + root.width/2
//Snap
if (Math.abs(value) < 5) {
root.value = 0
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment