mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-27 22:33:08 +00:00
position mapping fixes
This commit is contained in:
parent
ff2fe85d93
commit
39a4ae5780
2 changed files with 13 additions and 3 deletions
|
|
@ -39,4 +39,10 @@ LauncherContainer {
|
|||
|
||||
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 {
|
|||
}
|
||||
|
||||
function changeContainer(item, container) {
|
||||
var pos = container.contentItem.mapFromItem(item, 0, 0);
|
||||
var pos;
|
||||
|
||||
if (container == appletsLayout) {
|
||||
pos = container.mapFromItem(item, 0, 0);
|
||||
item.parent = container;
|
||||
} else {
|
||||
pos = container.contentItem.mapFromItem(item, 0, 0);
|
||||
item.parent = container.contentItem;
|
||||
}
|
||||
|
||||
|
|
@ -90,7 +92,9 @@ QtObject {
|
|||
|
||||
// Search Left
|
||||
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) {
|
||||
child = candidate;
|
||||
break;
|
||||
|
|
@ -99,7 +103,7 @@ QtObject {
|
|||
|
||||
// Search Right
|
||||
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) {
|
||||
child = candidate;
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue