1
0
mirror of https://github.com/KDE/latte-dock.git synced 2024-12-25 09:33:51 +03:00

decouple task realremanimation from launcheranim

This commit is contained in:
Michail Vourlakos 2021-10-28 01:03:12 +03:00
parent cea203e8ad
commit 3a662f98c3
4 changed files with 25 additions and 17 deletions

View File

@ -80,6 +80,8 @@ AbilityItem.BasicItem {
property bool inPopup: false
property bool inRemoveStage: false
property bool isLauncherAnimationRunning: false
//! after clicking to show/hide preview enter events are trigerred even though the should not
property bool showPreviewsIsBlockedFromReleaseEvent: false
@ -945,5 +947,10 @@ AbilityItem.BasicItem {
///Item's Removal Animation
ListView.onRemove: TaskAnimations.RealRemovalAnimation{ id: taskRealRemovalAnimation }
onIsLauncherAnimationRunningChanged: {
if (!isLauncherAnimationRunning && taskRealRemovalAnimation.paused) {
taskRealRemovalAnimation.resume();
}
}
}// main Item

View File

@ -15,6 +15,8 @@ Item{
property bool launchedAlready: false
property int speed: 0.9 * taskItem.abilities.animations.speedFactor.current * taskItem.abilities.animations.duration.large
readonly property bool running: launcherAnimationLoader.item ? launcherAnimationLoader.item.running : false
readonly property string needThicknessEvent: launcherAnimation + "_launcher"
Loader {
@ -39,6 +41,12 @@ Item{
}
}
Binding {
target: taskItem
property: "isLauncherAnimationRunning"
value: running
}
function clearAnimationsSignals() {
if ( launchedAlready && root.noTasksInAnimation>0 ) {
root.noTasksInAnimation--;
@ -84,8 +92,8 @@ Item{
if(root.launcherBouncingEnabled){
taskItem.animationStarted();
init();
taskItem.launcherAction();
launcherAnimationLoader.item.start();
taskItem.launcherAction();
} else {
launcherAnimationLoader.item.stop();
taskItem.launcherAction();

View File

@ -110,24 +110,17 @@ SequentialAnimation {
&& !taskItem.inBouncingAnimation && LatteCore.WindowSystem.compositingActive) {
tasksExtendedManager.setFrozenTask(taskItem.launcherUrl, taskItem.parabolicItem.zoom);
}
if (taskItem.isLauncherAnimationRunning && !taskItem.isSeparator) {
taskRealRemovalAnimation.pause();
}
}
}
//Ghost animation that acts as a delayer in case there is a bouncing animation
//taking place
PropertyAnimation {
target: taskItem.parabolicItem
property: "opacity"
to: 1
//this duration must be a bit less than the bouncing animation. Otherwise the
//smooth transition between removals is breaking
duration: taskItem.inBouncingAnimation && !taskItem.isSeparator? 4*launcherSpeedStep + 50 : 0
easing.type: Easing.InQuad
property int launcherSpeedStep: 0.8 * taskItem.abilities.animations.speedFactor.current * taskItem.abilities.animations.duration.large
//! Wait for launcher animation to finish before continue with real removal
PauseAnimation {
duration: taskItem.isLauncherAnimationRunning && !taskItem.isSeparator ? 50 : 0
}
//end of ghost animation
PropertyAnimation {
target: taskItem.parabolicItem

View File

@ -49,7 +49,7 @@ SequentialAnimation{
target: taskItem.parabolicItem
property: "zoomLength"
to: 1
duration: taskItem.abilities.animations.speedFactor.current*launcherAnimation.speed
duration: 0.5 * taskItem.abilities.animations.speedFactor.current*launcherAnimation.speed
easing.type: Easing.OutBounce
}
@ -57,7 +57,7 @@ SequentialAnimation{
target: taskItem.parabolicItem
property: "zoom"
to: 1
duration: taskItem.abilities.animations.speedFactor.current*launcherAnimation.speed
duration: 0.5 * taskItem.abilities.animations.speedFactor.current*launcherAnimation.speed
easing.type: Easing.OutQuad
}
}