diff --git a/containment/package/contents/ui/main.qml b/containment/package/contents/ui/main.qml index ce6269995..91c4fac12 100644 --- a/containment/package/contents/ui/main.qml +++ b/containment/package/contents/ui/main.qml @@ -425,10 +425,10 @@ DragDrop.DropArea { if (editMode) { visibilityManager.updateMaskArea(); updateAutomaticIconSize(); + clearZoom(); } else { updateAutomaticIconSize(); layoutsContainer.updateSizeForAppletsInFill(); - // setGlobalDirectRender(false); } updateLayouts(); diff --git a/plasmoid/package/contents/ui/main.qml b/plasmoid/package/contents/ui/main.qml index 5fc67b63a..f2923d7a2 100644 --- a/plasmoid/package/contents/ui/main.qml +++ b/plasmoid/package/contents/ui/main.qml @@ -57,7 +57,6 @@ Item { //it is used to check both the applet and the containment for direct render property bool globalDirectRender: latteDock ? latteDock.globalDirectRender : icList.directRender - property bool directRenderTimerIsRunning: latteDock ? latteDock.directRenderTimerIsRunning : enableDirectRenderTimer.running property bool editMode: latteDock ? latteDock.editMode : plasmoid.userConfiguring property bool disableRestoreZoom: false //blocks restore animation in rightClick @@ -831,14 +830,9 @@ Item { if(root.latteDock) console.log("Plasmoid, checkListHoveredTimer was called, even though it shouldnt..."); - if ((latteDock && !latteDock.dockContainsMouse) || !root.containsMouse()) { - if (enableDirectRenderTimer.running) - enableDirectRenderTimer.stop(); + if (!root.containsMouse()) { icList.directRender = false; - if(root.latteDock) { - root.latteDock.startEnableDirectRenderTimer(); - } root.clearZoom(); } @@ -863,29 +857,6 @@ Item { } } - //this timer adds a delay into enabling direct rendering... - //it gives the time to neighbour tasks to complete their animation - //during first hovering phase - //IMPORTANT ::: This timer should be used only when the Latte plasmoid - //is not inside a Latte dock - Timer { - id: enableDirectRenderTimer - interval: 4 * root.durationTime * units.shortDuration - onTriggered: { - if(root.latteDock) - console.log("Plasmoid, enableDirectRenderTimer was called, even though it shouldnt..."); - - if (waitingLaunchers.length > 0) - restart(); - else - icList.directRender = true; - - if (latteDock && latteDock.debugModeTimers) { - console.log("plasmoid timer: enableDirectRenderTimer called..."); - } - } - } - //this timer restores the draggingPhase flag to false //after a dragging has finished... This delay is needed //in order to not animate any tasks are added after a @@ -1573,7 +1544,7 @@ Item { } //if (previewContainsMouse()) - // windowsPreviewDlg.hide(4); + // windowsPreviewDlg.hide(4); if (previewContainsMouse()) return true; @@ -1631,12 +1602,22 @@ Item { dragSource = null; } - function startEnableDirectRenderTimer() { + function setGlobalDirectRender(value) { + if (waitingLaunchers.length > 0) + return; + if (latteDock) { - // latteDock.setGlobalDirectRender(true); - latteDock.startEnableDirectRenderTimer(); + latteDock.setGlobalDirectRender(value); } else { - enableDirectRenderTimer.start(); + if (value === true) { + if (root.containsMouse()) { + icList.directRender = true; + } else { + // console.log("direct render true ignored..."); + } + } else { + icList.directRender = false; + } } } diff --git a/plasmoid/package/contents/ui/task/TaskDelegate.qml b/plasmoid/package/contents/ui/task/TaskDelegate.qml index 27dd024e0..2651cad98 100644 --- a/plasmoid/package/contents/ui/task/TaskDelegate.qml +++ b/plasmoid/package/contents/ui/task/TaskDelegate.qml @@ -87,6 +87,7 @@ MouseArea{ property bool buffersAreReady: false property bool fastEnteringFlag: false //!flag to check if the mouse entered the dock very fast property bool delayingRemove: ListView.delayRemove + property bool scalesUpdatedOnce: false //states that exist in windows in a Group of windows property bool hasActive: isActive property bool hasMinimized: (IsGroupParent === true) ? tasksWindows.hasMinimized : isMinimized @@ -503,12 +504,16 @@ MouseArea{ if (root.editMode) return; + if (restoreAnimation.running) { + restoreAnimation.stop(); + } + // console.log("entered task:" + icList.hoveredIndex); if (fastEnteringFlag) { fastEnteringFlag = false; } - if (icList.hoveredIndex!==-1 && !root.directRenderTimerIsRunning && !root.globalDirectRender) { + if (icList.hoveredIndex!==-1 && !root.globalDirectRender) { fastEnteringFlag = true; } @@ -531,7 +536,7 @@ MouseArea{ return; } - /* if((!inAnimation)&&(root.dragSource == null)&&(!root.taskInAnimation) && hoverEnabled){ + /* if((!inAnimation)&&(root.dragSource == null)&&(!root.taskInAnimation) && hoverEnabled){ if (inAttentionAnimation) { var subSpacerScale = (root.zoomFactor-1)/2; hiddenSpacerLeft.nScale = subSpacerScale; @@ -553,6 +558,12 @@ MouseArea{ // IMPORTANT: This must be improved ! even for small miliseconds it reduces performance onExited: { + mainItemContainer.scalesUpdatedOnce = false; + + if (fastEnteringFlag) { + fastEnteringFlag = false; + } + if (root.latteDock && (!root.showPreviews || (root.showPreviews && isLauncher))){ root.latteDock.hideTooltipLabel(); } @@ -584,33 +595,34 @@ MouseArea{ return; } - if (fastEnteringFlag) { - var lengthPos; - if (root.vertical) { - lengthPos = mouse.x; - } else { - lengthPos = mouse.y; - } - - //! check if the mouse enters a second task and it is near the center - //! this way the directRendering isnt activated too fast or when the - //! mouse enters between two tasks at start - if (lengthPos >= (wrapper.center - root.iconSize/2) - && lengthPos <= (wrapper.center + root.iconSize/2)) { - if (!root.directRenderTimerIsRunning && !root.globalDirectRender) { - root.startEnableDirectRenderTimer(); - } - - fastEnteringFlag = false; - } - } - if((inAnimation == false)&&(!root.taskInAnimation)&&(!root.disableRestoreZoom) && hoverEnabled){ if (!latteDock || (latteDock && !(latteDock.dockIsHidden || latteDock.inSlidingIn || latteDock.inSlidingOut))){ icList.hoveredIndex = index; } - if( ((wrapper.mScale == 1 || wrapper.mScale === root.zoomFactor) && !root.globalDirectRender) || root.globalDirectRender) { + if (fastEnteringFlag) { + var lengthPos; + if (root.vertical) { + lengthPos = mouse.x; + } else { + lengthPos = mouse.y; + } + + //! check if the mouse enters a second task and it is near the center + //! this way the directRendering isnt activated too fast or when the + //! mouse enters between two tasks at start + if (lengthPos >= (wrapper.center - root.iconSize/2) + && lengthPos <= (wrapper.center + root.iconSize/2)) { + if (!root.globalDirectRender) { + root.setGlobalDirectRender(true); + } + + fastEnteringFlag = false; + } + } + + if( ((wrapper.mScale == 1 || wrapper.mScale === root.zoomFactor) && !root.globalDirectRender) + || root.globalDirectRender || !scalesUpdatedOnce) { if(root.dragSource == null){ if (icList.orientation == Qt.Horizontal){ var step = Math.abs(icList.currentSpot-mouse.x); @@ -840,15 +852,7 @@ MouseArea{ if(!root) return; - if (root.globalDirectRender) - wrapper.mScale = 1; - else if (!inAttentionAnimation && !inFastRestoreAnimation && !inMimicParabolicAnimation){ - if (icList.hoveredIndex === -1) { - restoreAnimation.start(); - } else { - console.log("Clear zoom signal ignored..."); - } - } + restoreAnimation.start(); } function handlerDraggingFinished(){ @@ -1213,6 +1217,23 @@ MouseArea{ onDragSourceChanged: mainItemContainer.updateAudioStreams() onIndicateAudioStreamsChanged: mainItemContainer.updateAudioStreams() } + + Connections { + target: root + onHoveredIndexChanged: { + if ((restoreAnimation.running) && (root.hoveredIndex !== -1)) { + restoreAnimation.stop(); + } + } + + onDockHoveredIndexChanged: { + if ((restoreAnimation.running) && (root.dockHoveredIndex !== -1)) { + restoreAnimation.stop(); + } + } + } + + ///// End of Helper functions //// Component.onCompleted: { diff --git a/plasmoid/package/contents/ui/task/TaskWrapper.qml b/plasmoid/package/contents/ui/task/TaskWrapper.qml index c2c461eb5..a6d250ea6 100644 --- a/plasmoid/package/contents/ui/task/TaskWrapper.qml +++ b/plasmoid/package/contents/ui/task/TaskWrapper.qml @@ -171,7 +171,7 @@ Item{ width: root.vertical ? wrapper.maxThickness-wrapper.width : 1 height: !root.vertical ? wrapper.maxThickness-wrapper.height : 1 - /* Rectangle{ + /* Rectangle{ width: !root.vertical ? 1 : parent.width height: !root.vertical ? parent.height : 1 x: !root.vertical ? wrapper.width /2 : 0 @@ -256,6 +256,8 @@ Item{ if (!mainItemContainer.inAttentionAnimation) mScale = root.zoomFactor; + + mainItemContainer.scalesUpdatedOnce = false; } } //nScale @@ -295,7 +297,7 @@ Item{ onMScaleChanged: { if ((mScale === root.zoomFactor) && !root.directRenderTimerIsRunning && !root.globalDirectRender) { - root.startEnableDirectRenderTimer(); + root.setGlobalDirectRender(true); } if (inMimicParabolicAnimation){ diff --git a/plasmoid/package/contents/ui/task/animations/TaskRestoreAnimation.qml b/plasmoid/package/contents/ui/task/animations/TaskRestoreAnimation.qml index 2657fb878..481d36d5e 100644 --- a/plasmoid/package/contents/ui/task/animations/TaskRestoreAnimation.qml +++ b/plasmoid/package/contents/ui/task/animations/TaskRestoreAnimation.qml @@ -68,9 +68,10 @@ SequentialAnimation{ onStopped: { //! VERY IMPORTANT CODE, fixes a bug when cycling the mouse very fast inside //! and outside the dock, in some rare cases the restoreAnimation didnt end!! - if (latteDock && (!latteDock.dockContainsMouse || icList.hoveredIndex === -1)) { - wrapper.mScale = 1; - } + + //if (latteDock && (!latteDock.dockContainsMouse || icList.hoveredIndex === -1)) { + // wrapper.mScale = 1; + //} // if (index === 2) // console.log("restore animation stopped... ind:"+index+" zoom:"+wrapper.mScale); }