fix glitches for task inAttention bouncing

v0.7
Michail Vourlakos 7 years ago
parent 569fd5d702
commit 5a9e788d8f

@ -95,6 +95,8 @@ MouseArea{
property bool inAttentionAnimation: false property bool inAttentionAnimation: false
property bool inBlockingAnimation: false property bool inBlockingAnimation: false
property bool inBouncingAnimation: false property bool inBouncingAnimation: false
property bool inMimicParabolicAnimation: false
property real mimicParabolicScale: -1
property bool inPopup: false property bool inPopup: false
property bool inRemoveStage: false property bool inRemoveStage: false
property bool inWheelAction: false property bool inWheelAction: false
@ -360,16 +362,21 @@ MouseArea{
NumberAnimation { duration: 3 * mainItemContainer.animationTime } NumberAnimation { duration: 3 * mainItemContainer.animationTime }
} }
Behavior on nScale { /*Behavior on nScale {
enabled: root.globalDirectRender enabled: root.globalDirectRender
NumberAnimation { duration: root.directRenderAnimationTime } NumberAnimation { duration: root.directRenderAnimationTime }
} }*/
Behavior on nHiddenSize { Behavior on nHiddenSize {
enabled: wrapper.opacity > 0 enabled: !root.globalDirectRender || mainItemContainer.inMimicParabolicAnimation
NumberAnimation { duration: 3 * mainItemContainer.animationTime } NumberAnimation { duration: 3 * mainItemContainer.animationTime }
} }
Behavior on nHiddenSize {
enabled: root.globalDirectRender && !mainItemContainer.inMimicParabolicAnimation
NumberAnimation { duration: root.directRenderAnimationTime }
}
/* Rectangle{ /* Rectangle{
width: !root.vertical ? parent.width : 1 width: !root.vertical ? parent.width : 1
height: !root.vertical ? 1 : parent.height height: !root.vertical ? 1 : parent.height
@ -452,10 +459,15 @@ MouseArea{
} }
Behavior on nHiddenSize { Behavior on nHiddenSize {
enabled: wrapper.opacity > 0 enabled: !root.globalDirectRender || mainItemContainer.inMimicParabolicAnimation
NumberAnimation { duration: 3 * mainItemContainer.animationTime } NumberAnimation { duration: 3 * mainItemContainer.animationTime }
} }
Behavior on nHiddenSize {
enabled: root.globalDirectRender && !mainItemContainer.inMimicParabolicAnimation
NumberAnimation { duration: root.directRenderAnimationTime }
}
/* Rectangle{ /* Rectangle{
width: !root.vertical ? parent.width : 1 width: !root.vertical ? parent.width : 1
height: !root.vertical ? 1 : parent.height height: !root.vertical ? 1 : parent.height
@ -1080,6 +1092,10 @@ MouseArea{
function slotMimicEnterForParabolic(){ function slotMimicEnterForParabolic(){
if (containsMouse) { if (containsMouse) {
if (!inBlockingAnimation || inAttentionAnimation) { if (!inBlockingAnimation || inAttentionAnimation) {
if (inMimicParabolicAnimation) {
mimicParabolicScale = root.zoomFactor;
}
wrapper.calculateScales(icList.currentSpot); wrapper.calculateScales(icList.currentSpot);
} }
} }

@ -106,7 +106,7 @@ Item{
signal runLauncherAnimation(); signal runLauncherAnimation();
/* Rectangle{ /* Rectangle{
anchors.fill: parent anchors.fill: parent
border.width: 1 border.width: 1
border.color: "green" border.color: "green"
@ -114,12 +114,12 @@ Item{
}*/ }*/
Behavior on mScale { Behavior on mScale {
enabled: !root.globalDirectRender enabled: !root.globalDirectRender || inMimicParabolicAnimation
NumberAnimation { duration: 3 * mainItemContainer.animationTime } NumberAnimation { duration: 3 * mainItemContainer.animationTime }
} }
Behavior on mScale { Behavior on mScale {
enabled: root.globalDirectRender enabled: root.globalDirectRender && !inMimicParabolicAnimation
NumberAnimation { duration: root.directRenderAnimationTime } NumberAnimation { duration: root.directRenderAnimationTime }
} }
@ -242,11 +242,19 @@ Item{
hiddenSpacerLeft.nScale = subSpacerScale; hiddenSpacerLeft.nScale = subSpacerScale;
hiddenSpacerRight.nScale = subSpacerScale; hiddenSpacerRight.nScale = subSpacerScale;
} else if (!inBlockingAnimation) { } else if (!inBlockingAnimation) {
var newScale = 1;
if(nScale >= 0) { if(nScale >= 0) {
mScale = nScale + step; newScale = nScale + step;
} else { } else {
mScale = mScale + step; newScale = mScale + step;
}
if (inMimicParabolicAnimation && mimicParabolicScale === -1) {
mimicParabolicScale = newScale;
} }
mScale = newScale;
} }
// console.log(index+ ", "+mScale); // console.log(index+ ", "+mScale);
} }
@ -264,6 +272,12 @@ Item{
root.startEnableDirectRenderTimer(); root.startEnableDirectRenderTimer();
} }
if (inMimicParabolicAnimation && mScale === mimicParabolicScale){
inMimicParabolicAnimation = false;
mimicParabolicScale = -1;
}
if ((mScale > 1) && !mainItemContainer.isZoomed) { if ((mScale > 1) && !mainItemContainer.isZoomed) {
mainItemContainer.isZoomed = true; mainItemContainer.isZoomed = true;
root.signalAnimationsNeedBothAxis(1); root.signalAnimationsNeedBothAxis(1);

@ -23,61 +23,67 @@ import QtQuick 2.0
import org.kde.plasma.plasmoid 2.0 import org.kde.plasma.plasmoid 2.0
///////Restore Zoom Animation///// ///////Restore Zoom Animation/////
ParallelAnimation{ SequentialAnimation{
id: fastRestoreAnimation id: fastRestoreAnimation
property int speed: 5*mainItemContainer.animationTime property int speed: 5*mainItemContainer.animationTime
PropertyAnimation { ScriptAction {
target: wrapper script: {
property: "mScale" mainItemContainer.inMimicParabolicAnimation = true;
to: 1 }
duration: fastRestoreAnimation.speed
easing.type: Easing.Linear
} }
PropertyAnimation { ParallelAnimation {
target: wrapper PropertyAnimation {
property: "tempScaleWidth" target: wrapper
to: 1 property: "mScale"
duration: fastRestoreAnimation.speed to: 1
easing.type: Easing.Linear duration: fastRestoreAnimation.speed
} easing.type: Easing.Linear
}
PropertyAnimation { PropertyAnimation {
target: wrapper target: wrapper
property: "tempScaleHeight" property: "tempScaleWidth"
to: 1 to: 1
duration: fastRestoreAnimation.speed duration: fastRestoreAnimation.speed
easing.type: Easing.Linear easing.type: Easing.Linear
} }
PropertyAnimation { PropertyAnimation {
target: hiddenSpacerLeft target: wrapper
property: "nScale" property: "tempScaleHeight"
to: 0 to: 1
duration: fastRestoreAnimation.speed duration: fastRestoreAnimation.speed
easing.type: Easing.Linear easing.type: Easing.Linear
} }
PropertyAnimation {
target: hiddenSpacerLeft
property: "nScale"
to: 0
duration: fastRestoreAnimation.speed
easing.type: Easing.Linear
}
PropertyAnimation { PropertyAnimation {
target: hiddenSpacerRight target: hiddenSpacerRight
property: "nScale" property: "nScale"
to: 0 to: 0
duration: fastRestoreAnimation.speed duration: fastRestoreAnimation.speed
easing.type: Easing.Linear easing.type: Easing.Linear
}
} }
onStopped: { onStopped: {
if (latteDock)
latteDock.setGlobalDirectRender(false);
else
icList.directRender = false;
if (newWindowAnimation.paused){ if (newWindowAnimation.paused){
if (!mainItemContainer.containsMouse && !parabolicManager.neighbourIsHovered(itemIndex)) {
mainItemContainer.inMimicParabolicAnimation = false;
}
newWindowAnimation.stop(); newWindowAnimation.stop();
root.mimicEnterForParabolic(); root.mimicEnterForParabolic();
//wrapper.calculateScales((root.iconSize+root.iconMargin)/2);
} }
} }

Loading…
Cancel
Save