ALWAYS Restore Task Animation

--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!!
pull/2/head
Michail Vourlakos 7 years ago
parent 2f45aa9129
commit 61227abaeb

@ -216,10 +216,12 @@ Item {
//outside the LatteApplet Plasmoid
//property int debCounter: 0;
function clearZoom(){
if (root.globalDirectRender){
wrapper.zoomScale = 1;
} else {
restoreAnimation.start();
if (layoutsContainer.hoveredIndex === -1) {
if (root.globalDirectRender){
wrapper.zoomScale = 1;
} else {
restoreAnimation.start();
}
}
}

@ -881,9 +881,6 @@ DragDrop.DropArea {
}
function clearZoom(){
//layoutsContainer.currentSpot = -1000;
//layoutsContainer.hoveredIndex = -1;
if (latteApplet){
latteApplet.clearZoom();
}
@ -1091,6 +1088,8 @@ DragDrop.DropArea {
if (value === true) {
if (dockContainsMouse && !rootMouseArea.containsMouse) {
root.globalDirectRender = true;
} else {
// console.log("direct render true ignored...");
}
} else {
root.globalDirectRender = false;
@ -1541,6 +1540,7 @@ DragDrop.DropArea {
enableDirectRenderTimer.stop();
setGlobalDirectRender(false);
root.initializeHoveredIndexes();
root.clearZoom();
}

@ -326,9 +326,8 @@ MouseArea{
onGlobalDirectRenderChanged:{
if (root.globalDirectRender && restoreAnimation.running) {
// console.log("CLEAR TASK SCALE !!!!");
// console.log("Cleat Task Scale !!!!");
restoreAnimation.stop();
wrapper.mScale = 1;
}
}
}
@ -812,8 +811,13 @@ MouseArea{
if (root.globalDirectRender)
wrapper.mScale = 1;
else if (!inAttentionAnimation && !inFastRestoreAnimation && !inMimicParabolicAnimation)
restoreAnimation.start();
else if (!inAttentionAnimation && !inFastRestoreAnimation && !inMimicParabolicAnimation){
if (icList.hoveredIndex === -1) {
restoreAnimation.start();
} else {
console.log("Clear zoom signal ignored...");
}
}
}
function handlerDraggingFinished(){

@ -23,34 +23,55 @@ import QtQuick 2.0
import org.kde.plasma.plasmoid 2.0
///////Restore Zoom Animation/////
ParallelAnimation{
SequentialAnimation{
id: restoreAnimation
PropertyAnimation {
target: wrapper
property: "mScale"
to: 1
duration: 4 * mainItemContainer.animationTime
easing.type: Easing.InCubic
}
ParallelAnimation{
PropertyAnimation {
target: wrapper
property: "mScale"
to: 1
duration: 4 * mainItemContainer.animationTime
easing.type: Easing.InCubic
}
PropertyAnimation {
target: hiddenSpacerLeft
property: "nScale"
to: 0
duration: 4 * mainItemContainer.animationTime
easing.type: Easing.InCubic
}
PropertyAnimation {
target: hiddenSpacerLeft
property: "nScale"
to: 0
duration: 4 * mainItemContainer.animationTime
easing.type: Easing.InCubic
}
PropertyAnimation {
target: hiddenSpacerRight
property: "nScale"
to: 0
duration: 4 * mainItemContainer.animationTime
easing.type: Easing.InCubic
PropertyAnimation {
target: hiddenSpacerRight
property: "nScale"
to: 0
duration: 4 * mainItemContainer.animationTime
easing.type: Easing.InCubic
}
}
//! debug code based on third task
/*ScriptAction{
script: {
if (index===2) {
console.log("restore script ended correctly...");
}
}
}
onStarted: {
// console.log("restore animation started...");
if (index === 2)
console.log("restore animation started...");
} */
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 (index === 2)
// console.log("restore animation stopped... ind:"+index+" zoom:"+wrapper.mScale);
}
}

Loading…
Cancel
Save