From 987cfba048e5bb1b090071dc002b8e263645eb24 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Wed, 3 May 2017 19:13:34 +0300 Subject: [PATCH] improve clearing parabolic effect calculations --adding the internal separator made the things a little more complicated. This commit improves the clearing calculations in order to not conflict the messages with each other and trying to restore all applets and tasks that are not considered for the parabolic effect. --- containment/contents/ui/AppletItem.qml | 11 +++--- plasmoid/contents/ui/TaskDelegate.qml | 49 ++++++++++++++++++++++---- 2 files changed, 48 insertions(+), 12 deletions(-) diff --git a/containment/contents/ui/AppletItem.qml b/containment/contents/ui/AppletItem.qml index a03a1a495..f17284c96 100644 --- a/containment/contents/ui/AppletItem.qml +++ b/containment/contents/ui/AppletItem.qml @@ -164,13 +164,12 @@ Item { //property int debCounter: 0; function interceptLatteAppletUpdateScale(dIndex, newScale, step){ if(!root.editMode){ - if(dIndex === -1){ - layoutsContainer.updateScale(index-1,newScale, step); + if(dIndex <= -1){ + layoutsContainer.updateScale(index+dIndex,newScale, step); } - else if(dIndex === root.tasksCount){ - // debCounter++; - // console.log(debCounter+ " "+dIndex+" "+newScale+" received..."); - layoutsContainer.updateScale(index+1,newScale, step); + else if(dIndex >= root.tasksCount){ + var dif = dIndex - root.tasksCount + 1; + layoutsContainer.updateScale(index+dif,newScale, step); } } } diff --git a/plasmoid/contents/ui/TaskDelegate.qml b/plasmoid/contents/ui/TaskDelegate.qml index 777b62263..9d100ef83 100644 --- a/plasmoid/contents/ui/TaskDelegate.qml +++ b/plasmoid/contents/ui/TaskDelegate.qml @@ -515,8 +515,16 @@ MouseArea{ root.updateScale(index-1, leftScale, 0); if(!root.hasInternalSeparator) { - root.updateScale(index+2, 1, 0); - root.updateScale(index-2, 1, 0); + //restore neighbour tasks + var hIndex = index + 2; + var lIndex = index - 2; + + if (hIndex<=icList.tasksCount) + root.updateScale(hIndex, 1, 0); + + if (lIndex>=-1) + root.updateScale(lIndex, 1, 0); + } else if(root.internalSeparatorPos>=0) { if(root.internalSeparatorPos === index+1){ if (!positiveDirection) { @@ -525,8 +533,16 @@ MouseArea{ root.updateScale(index+2, bsNeighbourZoom, 0); } - root.updateScale(index+3, 1, 0); - root.updateScale(index-2, 1, 0); + //restore neighbour tasks + var hIndex = index + 3; + var lIndex = index - 2; + + if (hIndex<=icList.tasksCount) + root.updateScale(hIndex, 1, 0); + + if (lIndex>=-1) + root.updateScale(lIndex, 1, 0); + } else if(root.internalSeparatorPos === index-1) { if (!positiveDirection) { root.updateScale(index-2, bsNeighbourZoom, 0); @@ -534,11 +550,32 @@ MouseArea{ root.updateScale(index-2, ssNeighbourZoom, 0); } - root.updateScale(index+2, 1, 0); - root.updateScale(index-3, 1, 0); + //restore neighbour tasks + var hIndex = index + 2; + var lIndex = index - 3; + + if (hIndex<=icList.tasksCount) + root.updateScale(hIndex, 1, 0); + + if (lIndex>=-1) + root.updateScale(lIndex, 1, 0); } } + //extra restoring signals for applets around the plasmoid + //at the low end + if (index>=2 || ((index>=1) && (!root.hasInternalSeparator || root.internalSeparatorPos>1)) ) { + root.updateScale(-1, 1, 0); + } + //at the high end + if (index<=root.tasksCount-3 + || ((index<=root.tasksCount-2) + && (!root.hasInternalSeparator + || (root.hasInternalSeparator && root.internalSeparatorPos 1)) && !root.disableLeftSpacer){ hiddenSpacerLeft.nScale = leftScale - 1;