on xenial help sign in
don't reach out of context
013e5b1Michael Zanetti
qml/Stage/Spread/SpreadDelegateInputArea.qml+14−11
@@ -28,6 +28,9 @@ Item {
28
28
29 readonly property alias distance: d.distance
29 readonly property alias distance: d.distance
30
30
31+ property var stage: null
32+ property var dragDelegate: null
33+
31 signal clicked()
34 signal clicked()
32 signal close()
35 signal close()
33
36
@@ -116,13 +119,13 @@ Item {
116
119
117 var value = tp.y - tp.startY - offset;
120 var value = tp.y - tp.startY - offset;
118 if (value < 0) {
121 if (value < 0) {
119− var coords = mapToItem(shell, tp.x, tp.y);
122+ var coords = mapToItem(stage, tp.x, tp.y);
120− fakeDragItem.Drag.hotSpot.x = fakeDragItem.width / 2
123+ dragDelegate.Drag.hotSpot.x = dragDelegate.width / 2
121− fakeDragItem.Drag.hotSpot.y = units.gu(2)
124+ dragDelegate.Drag.hotSpot.y = units.gu(2)
122− fakeDragItem.x = coords.x - fakeDragItem.Drag.hotSpot.x
125+ dragDelegate.x = coords.x - dragDelegate.Drag.hotSpot.x
123− fakeDragItem.y = coords.y - fakeDragItem.Drag.hotSpot.y
126+ dragDelegate.y = coords.y - dragDelegate.Drag.hotSpot.y
124− fakeDragItem.Drag.active = true;
127+ dragDelegate.Drag.active = true;
125− fakeDragItem.surface = model.window.surface;
128+ dragDelegate.surface = model.window.surface;
126
129
127 } else {
130 } else {
128 if (root.closeable) {
131 if (root.closeable) {
@@ -136,8 +139,8 @@ Item {
136 }
139 }
137
140
138 onReleased: {
141 onReleased: {
139− var result = fakeDragItem.Drag.drop();
142+ var result = dragDelegate.Drag.drop();
140− fakeDragItem.surface = null;
143+ dragDelegate.surface = null;
141
144
142 if (!d.moving) {
145 if (!d.moving) {
143 root.clicked()
146 root.clicked()
@@ -160,8 +163,8 @@ Item {
160 }
163 }
161
164
162 onCanceled: {
165 onCanceled: {
163− fakeDragItem.Drag.active = false;
166+ dragDelegate.Drag.active = false;
164− fakeDragItem.surface = null;
167+ dragDelegate.surface = null;
165 d.moving = false
168 d.moving = false
166 animation.animate("center");
169 animation.animate("center");
167 }
170 }
qml/Stage/Stage.qml+2
@@ -1832,6 +1832,8 @@ FocusScope {
1832 anchors.fill: decoratedWindow
1832 anchors.fill: decoratedWindow
1833 enabled: false
1833 enabled: false
1834 closeable: !appDelegate.isDash
1834 closeable: !appDelegate.isDash
1835+ stage: root
1836+ dragDelegate: fakeDragItem
1835
1837
1836 onClicked: {
1838 onClicked: {
1837 spreadItem.highlightedIndex = index;
1839 spreadItem.highlightedIndex = index;