From 263e21a961ae912ff83aa2dce9b8d336007eaeb7 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Fri, 24 Mar 2017 22:35:05 +0200 Subject: [PATCH] animate tasks during dragging --finally I found why moveDisplaced wasnt working correctly during dragging!!! ;) enjoy moving your launchers!!! --- plasmoid/contents/ui/MouseHandler.qml | 5 +++-- plasmoid/contents/ui/main.qml | 11 ++++++----- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/plasmoid/contents/ui/MouseHandler.qml b/plasmoid/contents/ui/MouseHandler.qml index 476ed5381..cad6d929e 100644 --- a/plasmoid/contents/ui/MouseHandler.qml +++ b/plasmoid/contents/ui/MouseHandler.qml @@ -44,7 +44,7 @@ Item { id: ignoreItemTimer repeat: false - interval: 750 + interval: 200 onTriggered: { ignoredItem = null; @@ -122,7 +122,7 @@ Item { && above.m.IsLauncher !== true && above == ignoredItem) { return; } else { - ignoredItem = null; + //ignoredItem = null; } //at some point it was needed the following && above != ignoredItem @@ -134,6 +134,7 @@ Item { if (root.dragSource != above && root.dragSource.itemIndex != insertAt) { // console.log(root.dragSource.itemIndex + " - "+insertAt); + root.dragSource.z = 100; tasksModel.move(root.dragSource.itemIndex, insertAt); ignoredItem = above; ignoreItemTimer.restart(); diff --git a/plasmoid/contents/ui/main.qml b/plasmoid/contents/ui/main.qml index 5db460291..928da00ad 100644 --- a/plasmoid/contents/ui/main.qml +++ b/plasmoid/contents/ui/main.qml @@ -774,7 +774,7 @@ Item { property bool delayingRemoval: false property bool directRender: false - onTasksCountChanged: updateImplicits(); + // onTasksCountChanged: updateImplicits(); // property int count: children ? children.length : 0 /* anchors.bottom: (root.position === PlasmaCore.Types.BottomPositioned) ? parent.bottom : undefined @@ -785,19 +785,19 @@ Item { anchors.horizontalCenter: !root.vertical ? parent.horizontalCenter : undefined anchors.verticalCenter: root.vertical ? parent.verticalCenter : undefined */ - width: contentWidth - height: contentHeight + width: !root.vertical ? contentWidth : mouseHandler.maxSize + height: root.vertical ? contentHeight : mouseHandler.maxSize orientation: Qt.Horizontal delegate: TaskDelegate{} - /*Rectangle{ + /* Rectangle{ anchors.fill: parent border.width: 1 border.color: "red" color: "transparent" - }*/ + } */ //the duration of this animation should be as small as possible //it fixes a small issue with the dragging an item to change it's @@ -1128,6 +1128,7 @@ Item { } function resetDragSource() { + dragSource.z = 0; dragSource = null; }