improve animationSenting fro DragDropArea

pull/6/head
Michail Vourlakos 6 years ago
parent 51c11071dd
commit 62b8aa6987

@ -40,6 +40,8 @@ DragDrop.DropArea {
property bool computationsAreValid: false property bool computationsAreValid: false
} }
property bool animationSent: false
Connections{ Connections{
target: root.dragInfo target: root.dragInfo
@ -112,7 +114,10 @@ DragDrop.DropArea {
dragInfo.onlyLaunchers = latteApplet ? latteApplet.launchersDrop(event) : false; dragInfo.onlyLaunchers = latteApplet ? latteApplet.launchersDrop(event) : false;
dragInfo.computationsAreValid = true; dragInfo.computationsAreValid = true;
if (!animationSent) {
animationSent = true;
slotAnimationsNeedLength(1); slotAnimationsNeedLength(1);
}
if (dragInfo.isTask || plasmoid.immutable || dockIsHidden || visibilityManager.inSlidingIn || visibilityManager.inSlidingOut) { if (dragInfo.isTask || plasmoid.immutable || dockIsHidden || visibilityManager.inSlidingIn || visibilityManager.inSlidingOut) {
event.ignore(); event.ignore();
@ -189,7 +194,8 @@ DragDrop.DropArea {
} }
onDragLeave: { onDragLeave: {
if (dragInfo.entered) { if (animationSent) {
animationSent = false;
slotAnimationsNeedLength(-1); slotAnimationsNeedLength(-1);
} }
@ -202,10 +208,12 @@ DragDrop.DropArea {
} }
onDrop: { onDrop: {
if (dragInfo.isTask || dockIsHidden || visibilityManager.inSlidingIn || visibilityManager.inSlidingOut) { if (animationSent) {
if (dragInfo.entered) { animationSent = false;
slotAnimationsNeedLength(-1); slotAnimationsNeedLength(-1);
} }
if (dragInfo.isTask || dockIsHidden || visibilityManager.inSlidingIn || visibilityManager.inSlidingOut) {
return; return;
} }
@ -218,9 +226,5 @@ DragDrop.DropArea {
root.addLaunchersMessage = false; root.addLaunchersMessage = false;
dndSpacer.opacity = 0; dndSpacer.opacity = 0;
if (dragInfo.entered) {
slotAnimationsNeedLength(-1);
}
} }
} }

Loading…
Cancel
Save