mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-04 02:34:45 +00:00
put items being dragged in a non scrolling overlay
This commit is contained in:
parent
36d080abe0
commit
cbea89b98c
2 changed files with 10 additions and 7 deletions
|
|
@ -23,7 +23,7 @@ import org.kde.plasma.private.containmentlayoutmanager 1.0 as ContainmentLayoutM
|
||||||
|
|
||||||
import org.kde.phone.homescreen 1.0
|
import org.kde.phone.homescreen 1.0
|
||||||
|
|
||||||
QtObject {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property ContainmentLayoutManager.AppletsLayout appletsLayout
|
property ContainmentLayoutManager.AppletsLayout appletsLayout
|
||||||
|
|
@ -80,7 +80,7 @@ QtObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Those should never be accessed from outside
|
// Those should never be accessed from outside
|
||||||
property QtObject __internal: QtObject {
|
QtObject {
|
||||||
id: internal
|
id: internal
|
||||||
function raiseContainer(container) {
|
function raiseContainer(container) {
|
||||||
container.z = 1;
|
container.z = 1;
|
||||||
|
|
@ -107,9 +107,9 @@ QtObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function changeContainer(item, container) {
|
function putItemInDragSpace(item) {
|
||||||
var pos = container.mapFromItem(item, 0, 0);
|
var pos = root.mapFromItem(item, 0, 0);
|
||||||
item.parent = container;
|
item.parent = root;
|
||||||
|
|
||||||
item.x = pos.x;
|
item.x = pos.x;
|
||||||
item.y = pos.y;
|
item.y = pos.y;
|
||||||
|
|
@ -171,7 +171,7 @@ QtObject {
|
||||||
|
|
||||||
if (container == appletsLayout) {
|
if (container == appletsLayout) {
|
||||||
spacer.visible = false;
|
spacer.visible = false;
|
||||||
changeContainer(item, container);
|
putItemInDragSpace(item);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -194,7 +194,7 @@ QtObject {
|
||||||
plasmoid.nativeInterface.stackAfter(spacer, child);
|
plasmoid.nativeInterface.stackAfter(spacer, child);
|
||||||
}
|
}
|
||||||
|
|
||||||
changeContainer(item, container);
|
putItemInDragSpace(item);
|
||||||
|
|
||||||
spacer.visible = true;
|
spacer.visible = true;
|
||||||
}
|
}
|
||||||
|
|
@ -205,6 +205,7 @@ QtObject {
|
||||||
raiseContainer(container);
|
raiseContainer(container);
|
||||||
|
|
||||||
if (container == appletsLayout) {
|
if (container == appletsLayout) {
|
||||||
|
item.parent = appletsLayout;
|
||||||
appletsLayout.positionItem(item);
|
appletsLayout.positionItem(item);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -118,6 +118,8 @@ Text {
|
||||||
|
|
||||||
Launcher.LauncherDragManager {
|
Launcher.LauncherDragManager {
|
||||||
id: launcherDragManager
|
id: launcherDragManager
|
||||||
|
anchors.fill: parent
|
||||||
|
z: 2
|
||||||
appletsLayout: appletsLayout
|
appletsLayout: appletsLayout
|
||||||
launcherGrid: launcher
|
launcherGrid: launcher
|
||||||
favoriteStrip: favoriteStrip
|
favoriteStrip: favoriteStrip
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue