on xenial help sign in
disable dragging of items with an angle > 20 degrees

add an animation for dragging of items with an angle > 0 and < 20 remove foldingMouseAreas as they are not needed any more after all the other dnd changes

commit2ec9e8483d58e49f65ac522c7765e760ebee7bf8 authorMichael Zanetti <michael.zanetti@canonical.com> dateMon 19 Aug 2013, 13:47 (13 years ago) parenta02fbf8
1 file changed+18−26
Launcher/LauncherPanel.qml+18−26
Launcher/LauncherPanel.qml+18−26
@@ -296,6 +296,10 @@ Item {
296296 }
297297
298298 onPressAndHold: {
299+ if (Math.abs(selectedItem.angle) > 30) {
300+ return;
301+ }
302+
299303 draggedIndex = Math.floor((mouseY + launcherListView.realContentY) / launcherListView.realItemHeight);
300304
301305 launcherListView.interactive = false
@@ -305,6 +309,9 @@ Item {
305309 fakeDragItem.iconName = launcherListView.model.get(draggedIndex).icon
306310 fakeDragItem.x = 0
307311 fakeDragItem.y = mouseY - yOffset + launcherListView.anchors.topMargin + launcherListView.topMargin
312+ fakeDragItem.angle = selectedItem.angle * (root.inverted ? -1 : 1)
313+ fakeDragItem.offset = selectedItem.offset * (root.inverted ? -1 : 1)
314+ fakeDragItem.flatten()
308315 drag.target = fakeDragItem
309316
310317 startX = mouseX
@@ -379,32 +386,6 @@ Item {
379386 }
380387 }
381388 }
382−
383− MouseArea {
384− id: topFoldingArea
385− anchors {
386− left: parent.left
387− right: parent.right
388− top: parent.top
389− topMargin: launcherListView.topMargin
390− }
391− height: launcherListView.itemSize / 2
392− enabled: launcherListView.contentY > -launcherListView.topMargin
393− onClicked: launcherListView.flick(0, launcherListView.clickFlickSpeed)
394− }
395−
396− MouseArea {
397− id: bottomFoldingArea
398− anchors {
399− left: parent.left
400− right: parent.right
401− bottom: parent.bottom
402− bottomMargin: launcherListView.bottomMargin
403− }
404− height: launcherListView.itemHeight / 2
405− enabled: launcherListView.contentHeight - launcherListView.height - launcherListView.contentY > -launcherListView.bottomMargin
406− onClicked: launcherListView.flick(0, -launcherListView.clickFlickSpeed)
407− }
408389 }
409390 }
410391
@@ -419,6 +400,17 @@ Item {
419400 rotation: root.rotation
420401 highlighted: true
421402 itemOpacity: 0.8
403+
404+ function flatten() {
405+ fakeDragItemAnimation.start();
406+ }
407+
408+ UbuntuNumberAnimation {
409+ id: fakeDragItemAnimation
410+ target: fakeDragItem;
411+ properties: "angle,offset";
412+ to: 0
413+ }
422414 }
423415 }
424416 }