Commit 39a4ae57 authored by Marco Martin's avatar Marco Martin

position mapping fixes

parent ff2fe85d
...@@ -39,4 +39,10 @@ LauncherContainer { ...@@ -39,4 +39,10 @@ LauncherContainer {
implicitWidth: launcherGrid.cellWidth * Math.max(1, plasmoid.nativeInterface.applicationListModel.favoriteCount) + leftPadding + rightPadding implicitWidth: launcherGrid.cellWidth * Math.max(1, plasmoid.nativeInterface.applicationListModel.favoriteCount) + leftPadding + rightPadding
Behavior on width {
NumberAnimation {
duration: units.longDuration
easing.type: Easing.InOutQuad
}
}
} }
...@@ -59,11 +59,13 @@ QtObject { ...@@ -59,11 +59,13 @@ QtObject {
} }
function changeContainer(item, container) { function changeContainer(item, container) {
var pos = container.contentItem.mapFromItem(item, 0, 0); var pos;
if (container == appletsLayout) { if (container == appletsLayout) {
pos = container.mapFromItem(item, 0, 0);
item.parent = container; item.parent = container;
} else { } else {
pos = container.contentItem.mapFromItem(item, 0, 0);
item.parent = container.contentItem; item.parent = container.contentItem;
} }
...@@ -90,7 +92,9 @@ QtObject { ...@@ -90,7 +92,9 @@ QtObject {
// Search Left // Search Left
for (var i = 0; i < item.width * 2; i += item.width/2) { for (var i = 0; i < item.width * 2; i += item.width/2) {
var candidate = container.flow.childAt(item.x + dragCenterX + i, item.y + dragCenterY); var candidate = container.flow.childAt(
Math.min(container.flow.width, Math.max(0, item.x + dragCenterX + i)),
Math.min(container.flow.height-1, Math.max(0, item.y + dragCenterY)));
if (candidate && i < distance) { if (candidate && i < distance) {
child = candidate; child = candidate;
break; break;
...@@ -99,7 +103,7 @@ QtObject { ...@@ -99,7 +103,7 @@ QtObject {
// Search Right // Search Right
for (var i = 0; i < item.width * 2; i += item.width/2) { for (var i = 0; i < item.width * 2; i += item.width/2) {
var candidate = container.flow.childAt(item.x + dragCenterX - i, item.y + dragCenterY); var candidate = container.flow.childAt(Math.min(container.flow.width, Math.max(0, item.x + dragCenterX - i)), Math.min(container.flow.height-1, Math.max(0, item.y + dragCenterY)));
if (candidate && i < distance) { if (candidate && i < distance) {
child = candidate; child = candidate;
break; break;
......
Markdown is supported
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