From adba5b6f2abd201ee712c9d84abf6f58e76a9fa0 Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Thu, 4 May 2017 20:40:44 +0300 Subject: [PATCH] simplify parabolic signalling --this finally creates a very concrete parabolic animation experience --- containment/contents/ui/AppletItem.qml | 105 +++++++------------------ containment/contents/ui/main.qml | 3 +- plasmoid/contents/ui/TaskDelegate.qml | 93 +++++----------------- 3 files changed, 48 insertions(+), 153 deletions(-) diff --git a/containment/contents/ui/AppletItem.qml b/containment/contents/ui/AppletItem.qml index 99e873fe2..8d8c9d704 100644 --- a/containment/contents/ui/AppletItem.qml +++ b/containment/contents/ui/AppletItem.qml @@ -162,18 +162,6 @@ Item { //this functions gets the signal from the plasmoid, it can be used for signal items //outside the LatteApplet Plasmoid //property int debCounter: 0; - function interceptLatteAppletUpdateScale(dIndex, newScale, step){ - if(!root.editMode){ - if(dIndex <= -1){ - layoutsContainer.updateScale(index+dIndex,newScale, step); - } - else if(dIndex >= root.tasksCount){ - var dif = dIndex - root.tasksCount + 1; - layoutsContainer.updateScale(index+dif,newScale, step); - } - } - } - function clearZoom(){ if (root.globalDirectRender){ wrapper.zoomScale = 1; @@ -265,7 +253,6 @@ Item { root.latteAppletPos = index; latteApplet.latteDock = root; latteApplet.forceHidePanel = true; - latteApplet.updateScale.connect(interceptLatteAppletUpdateScale); } } @@ -905,57 +892,34 @@ Item { leftScale = bigNeighbourZoom; } - //! compute the neighbour separator scales for latteApplet - var bsNeighbourZoom = 1; - var ssNeighbourZoom = 1; - - if(root.latteApplet && root.latteApplet.internalSeparatorPos>=0) { - var latApp = root.latteApplet; - - if((latApp.internalSeparatorPos === latApp.tasksCount - 1) || (latApp.internalSeparatorPos === 0) && - (index === root.latteAppletPos-1 || index === root.latteAppletPos+1 )){ - var maxTaskLength = latApp.maxSeparatorLength+latApp.missingSeparatorLength; - var sepZoomDifference = (latApp.maxSeparatorLength / maxTaskLength) * root.zoomFactor; - - bsNeighbourZoom = Math.max(1,bigNeighbourZoom - sepZoomDifference); - ssNeighbourZoom = Math.max(1,smallNeighbourZoom - sepZoomDifference); - - if(latApp.internalSeparatorPos === 0 && (index === root.latteAppletPos-1) ){ - if (!positiveDirection) { - latApp.updateScale(1, ssNeighbourZoom, 0); - } else { - latApp.updateScale(1, bsNeighbourZoom, 0); - } - } else if((latApp.internalSeparatorPos === latApp.tasksCount - 1) &&(index === root.latteAppletPos+1)) { - if (!positiveDirection) { - latApp.updateScale(latApp.tasksCount-2, bsNeighbourZoom, 0); - } else { - latApp.updateScale(latApp.tasksCount-2, ssNeighbourZoom, 0); - } - } - } - } - // console.log("--------------") // console.debug(leftScale + " " + rightScale + " " + index); //activate messages to update the the neighbour scales - layoutsContainer.updateScale(index-1, leftScale, 0); - layoutsContainer.updateScale(index+1, rightScale, 0); - //these messages interfere when an applet is hidden, that is why I disabled them - // currentLayout.updateScale(index-2, 1, 0); - // currentLayout.updateScale(index+2, 1, 0); - - if (root.latteApplet) { - if ((index-1) > root.latteAppletPos ){ - root.latteApplet.updateScale(root.tasksCount-1, 1 ,0); - } else if((index+1) 2){ - root.latteApplet.clearZoom(); - } - } //Left hiddenSpacer if(container.startEdge){ @@ -985,34 +949,19 @@ Item { else zoomScale = zoomScale + step; } - else{ - if(layoutsContainer.hoveredIndexcontainer.index) { - latteApplet.updateScale(root.tasksCount-1, nScale, step); - if (root.latteInternalSeparatorPos!==root.tasksCount-1) - latteApplet.updateScale(root.tasksCount-2, 1, 0); - else - latteApplet.updateScale(root.tasksCount-3, 1, 0); - } - } } ///if the applet is hidden must forward its scale events to its neighbours else if ((applet && (applet.status === PlasmaCore.Types.HiddenStatus)) || container.isInternalViewSplitter){ if(layoutsContainer.hoveredIndex>index) - layoutsContainer.updateScale(index-1, nScale, step); + root.updateScale(index-1, nScale, step); else if((layoutsContainer.hoveredIndex=0) { - if((root.internalSeparatorPos === index+1) || (root.internalSeparatorPos === index-1) ){ - var sepZoomDifference = (root.maxSeparatorLength / (root.maxSeparatorLength+root.missingSeparatorLength)) * root.zoomFactor; - - bsNeighbourZoom = Math.max(1,bigNeighbourZoom - sepZoomDifference); - ssNeighbourZoom = Math.max(1,smallNeighbourZoom - sepZoomDifference); - } - } - // console.debug(leftScale + " " + rightScale + " " + index); //activate messages to update the the neighbour scales - root.updateScale(index+1, rightScale, 0); - root.updateScale(index-1, leftScale, 0); - - if(!root.hasInternalSeparator) { - //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) { - root.updateScale(index+2, ssNeighbourZoom, 0); - } else { - root.updateScale(index+2, bsNeighbourZoom, 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); - } else { - root.updateScale(index-2, ssNeighbourZoom, 0); - } - - //restore neighbour tasks - /* var hIndex = index + 2; - var lIndex = index - 3; + if(root.latteDock && index === root.tasksCount-1) + latteDock.updateScale(latteDock.latteAppletPos+1, rightScale, 0); + else + root.updateScale(index+1, rightScale, 0); - if (hIndex<=icList.tasksCount) - root.updateScale(hIndex, 1, 0); + if(root.latteDock && index === 0) + latteDock.updateScale(latteDock.latteAppletPos-1, leftScale, 0); + else + root.updateScale(index-1, leftScale, 0); - if (lIndex>=-1) - root.updateScale(lIndex, 1, 0);*/ - } - } + if(root.latteDock && index === root.tasksCount-1) + latteDock.updateScale(latteDock.latteAppletPos+2, 1, 0); + else if (root.latteDock && index === root.tasksCount-2) + latteDock.updateScale(latteDock.latteAppletPos+1, 1, 0); + else + root.updateScale(index+2, 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){