diff --git a/app/view/indicator/indicatorinfo.cpp b/app/view/indicator/indicatorinfo.cpp index f0c6b532f..d786ca227 100644 --- a/app/view/indicator/indicatorinfo.cpp +++ b/app/view/indicator/indicatorinfo.cpp @@ -84,6 +84,66 @@ void Info::setProvidesHoveredAnimation(bool provides) emit providesHoveredAnimationChanged(); } +bool Info::providesInAttentionAnimation() const +{ + return m_providesInAttentionAnimation; +} + +void Info::setProvidesInAttentionAnimation(bool provides) +{ + if (m_providesInAttentionAnimation == provides) { + return; + } + + m_providesInAttentionAnimation = provides; + emit providesInAttentionAnimationChanged(); +} + +bool Info::providesTaskLauncherAnimation() const +{ + return m_providesTaskLauncherAnimation; +} + +void Info::setProvidesTaskLauncherAnimation(bool provides) +{ + if (m_providesTaskLauncherAnimation == provides) { + return; + } + + m_providesTaskLauncherAnimation = provides; + emit providesTaskLauncherAnimationChanged(); +} + +bool Info::providesGroupedWindowAddedAnimation() const +{ + return m_providesGroupedWindowAddedAnimation; +} + +void Info::setProvidesGroupedWindowAddedAnimation(bool provides) +{ + if (m_providesGroupedWindowAddedAnimation == provides) { + return; + } + + m_providesGroupedWindowAddedAnimation = provides; + emit providesGroupedWindowAddedAnimationChanged(); +} + +bool Info::providesGroupedWindowRemovedAnimation() const +{ + return m_providesGroupedWindowRemovedAnimation; +} + +void Info::setProvidesGroupedWindowRemovedAnimation(bool provides) +{ + if (m_providesGroupedWindowRemovedAnimation == provides) { + return; + } + + m_providesGroupedWindowRemovedAnimation = provides; + emit providesGroupedWindowRemovedAnimationChanged(); +} + bool Info::providesFrontLayer() const { return m_providesFrontLayer; diff --git a/app/view/indicator/indicatorinfo.h b/app/view/indicator/indicatorinfo.h index cf8b32af7..84a255c34 100644 --- a/app/view/indicator/indicatorinfo.h +++ b/app/view/indicator/indicatorinfo.h @@ -22,8 +22,14 @@ class Info: public QObject Q_OBJECT Q_PROPERTY(bool needsIconColors READ needsIconColors WRITE setNeedsIconColors NOTIFY needsIconColorsChanged) Q_PROPERTY(bool needsMouseEventCoordinates READ needsMouseEventCoordinates WRITE setNeedsMouseEventCoordinates NOTIFY needsMouseEventCoordinatesChanged) + Q_PROPERTY(bool providesClickedAnimation READ providesClickedAnimation WRITE setProvidesClickedAnimation NOTIFY providesClickedAnimationChanged) Q_PROPERTY(bool providesHoveredAnimation READ providesHoveredAnimation WRITE setProvidesHoveredAnimation NOTIFY providesHoveredAnimationChanged) + Q_PROPERTY(bool providesInAttentionAnimation READ providesInAttentionAnimation WRITE setProvidesInAttentionAnimation NOTIFY providesInAttentionAnimationChanged) + Q_PROPERTY(bool providesTaskLauncherAnimation READ providesTaskLauncherAnimation WRITE setProvidesTaskLauncherAnimation NOTIFY providesTaskLauncherAnimationChanged) + Q_PROPERTY(bool providesGroupedWindowAddedAnimation READ providesGroupedWindowAddedAnimation WRITE setProvidesGroupedWindowAddedAnimation NOTIFY providesGroupedWindowAddedAnimationChanged) + Q_PROPERTY(bool providesGroupedWindowRemovedAnimation READ providesGroupedWindowRemovedAnimation WRITE setProvidesGroupedWindowRemovedAnimation NOTIFY providesGroupedWindowRemovedAnimationChanged) + Q_PROPERTY(bool providesFrontLayer READ providesFrontLayer WRITE setProvidesFrontLayer NOTIFY providesFrontLayerChanged) Q_PROPERTY(int extraMaskThickness READ extraMaskThickness WRITE setExtraMaskThickness NOTIFY extraMaskThicknessChanged) @@ -47,6 +53,18 @@ public: bool providesHoveredAnimation() const; void setProvidesHoveredAnimation(bool provides); + bool providesInAttentionAnimation() const; + void setProvidesInAttentionAnimation(bool provides); + + bool providesTaskLauncherAnimation() const; + void setProvidesTaskLauncherAnimation(bool provides); + + bool providesGroupedWindowAddedAnimation() const; + void setProvidesGroupedWindowAddedAnimation(bool provides); + + bool providesGroupedWindowRemovedAnimation() const; + void setProvidesGroupedWindowRemovedAnimation(bool provides); + bool providesFrontLayer() const; void setProvidesFrontLayer(bool front); @@ -67,6 +85,10 @@ signals: void needsMouseEventCoordinatesChanged(); void providesClickedAnimationChanged(); void providesHoveredAnimationChanged(); + void providesInAttentionAnimationChanged(); + void providesTaskLauncherAnimationChanged(); + void providesGroupedWindowAddedAnimationChanged(); + void providesGroupedWindowRemovedAnimationChanged(); void providesFrontLayerChanged(); private: @@ -74,6 +96,10 @@ private: bool m_needsMouseEventCoordinates{false}; bool m_providesClickedAnimation{false}; bool m_providesHoveredAnimation{false}; + bool m_providesInAttentionAnimation{false}; + bool m_providesTaskLauncherAnimation{false}; + bool m_providesGroupedWindowAddedAnimation{false}; + bool m_providesGroupedWindowRemovedAnimation{false}; bool m_providesFrontLayer{false}; int m_extraMaskThickness{0}; diff --git a/containment/package/contents/ui/abilities/Indicators.qml b/containment/package/contents/ui/abilities/Indicators.qml index 51ee6fde9..08a7d1a8b 100644 --- a/containment/package/contents/ui/abilities/Indicators.qml +++ b/containment/package/contents/ui/abilities/Indicators.qml @@ -42,6 +42,18 @@ Ability.IndicatorsPrivate { providesClickedAnimation: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("providesClickedAnimation") && indicatorLevel.item.providesClickedAnimation + providesInAttentionAnimation: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("providesInAttentionAnimation") + && indicatorLevel.item.providesInAttentionAnimation + + providesGroupedWindowAddedAnimation: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("providesGroupedWindowAddedAnimation") + && indicatorLevel.item.providesGroupedWindowAddedAnimation + + providesGroupedWindowRemovedAnimation: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("providesGroupedWindowRemovedAnimation") + && indicatorLevel.item.providesGroupedWindowRemovedAnimation + + providesTaskLauncherAnimation: indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("providesTaskLauncherAnimation") + && indicatorLevel.item.providesTaskLauncherAnimation + extraMaskThickness: { if (indicatorLevel.isLoaded && indicatorLevel.item.hasOwnProperty("extraMaskThickness")) { return indicatorLevel.item.extraMaskThickness; diff --git a/containment/package/contents/ui/abilities/privates/IndicatorsPrivate.qml b/containment/package/contents/ui/abilities/privates/IndicatorsPrivate.qml index 1f3877949..8094e9b75 100644 --- a/containment/package/contents/ui/abilities/privates/IndicatorsPrivate.qml +++ b/containment/package/contents/ui/abilities/privates/IndicatorsPrivate.qml @@ -66,6 +66,34 @@ AbilityHost.Indicators { value: _indicators.info.providesHoveredAnimation } + Binding{ + target: view && view.indicator ? view.indicator.info : null + property:"providesInAttentionAnimation" + when: view && view.indicator + value: _indicators.info.providesInAttentionAnimation + } + + Binding{ + target: view && view.indicator ? view.indicator.info : null + property:"providesTaskLauncherAnimation" + when: view && view.indicator + value: _indicators.info.providesTaskLauncherAnimation + } + + Binding{ + target: view && view.indicator ? view.indicator.info : null + property:"providesGroupedWindowAddedAnimation" + when: view && view.indicator + value: _indicators.info.providesGroupedWindowAddedAnimation + } + + Binding{ + target: view && view.indicator ? view.indicator.info : null + property:"providesGroupedWindowRemovedAnimation" + when: view && view.indicator + value: _indicators.info.providesGroupedWindowRemovedAnimation + } + Binding{ target: view && view.indicator ? view.indicator.info : null property:"providesFrontLayer" diff --git a/declarativeimports/abilities/client/Indicators.qml b/declarativeimports/abilities/client/Indicators.qml index 012839a52..98851b3ea 100644 --- a/declarativeimports/abilities/client/Indicators.qml +++ b/declarativeimports/abilities/client/Indicators.qml @@ -33,6 +33,10 @@ AbilityDefinition.Indicators { info.providesFrontLayer: false info.providesHoveredAnimation: false info.providesClickedAnimation: false + info.providesTaskLauncherAnimation: false + info.providesInAttentionAnimation: false + info.providesGroupedWindowAddedAnimation: false + info.providesGroupedWindowRemovedAnimation: false info.extraMaskThickness: 0 info.backgroundCornerMargin: 1.00 info.lengthPadding: 0.08 diff --git a/declarativeimports/abilities/definition/Indicators.qml b/declarativeimports/abilities/definition/Indicators.qml index 79d487c02..e60393914 100644 --- a/declarativeimports/abilities/definition/Indicators.qml +++ b/declarativeimports/abilities/definition/Indicators.qml @@ -27,6 +27,10 @@ Item{ providesFrontLayer: false providesHoveredAnimation: false providesClickedAnimation: false + providesTaskLauncherAnimation: false + providesInAttentionAnimation: false + providesGroupedWindowAddedAnimation: false + providesGroupedWindowRemovedAnimation: false extraMaskThickness: 0 diff --git a/declarativeimports/abilities/definition/indicators/IndicatorInfo.qml b/declarativeimports/abilities/definition/indicators/IndicatorInfo.qml index 1d528b3d3..6d1546e9c 100644 --- a/declarativeimports/abilities/definition/indicators/IndicatorInfo.qml +++ b/declarativeimports/abilities/definition/indicators/IndicatorInfo.qml @@ -14,6 +14,11 @@ Item{ property bool providesHoveredAnimation: false property bool providesClickedAnimation: false + property bool providesTaskLauncherAnimation: false + property bool providesInAttentionAnimation: false + property bool providesGroupedWindowAddedAnimation: false + property bool providesGroupedWindowRemovedAnimation: false + property int extraMaskThickness: 0 property real minThicknessPadding: 0 diff --git a/declarativeimports/abilities/items/BasicItem.qml b/declarativeimports/abilities/items/BasicItem.qml index 6ca4c2078..005abf1b6 100644 --- a/declarativeimports/abilities/items/BasicItem.qml +++ b/declarativeimports/abilities/items/BasicItem.qml @@ -22,6 +22,9 @@ Item{ signal mouseReleased(int x, int y, int button); signal shortcutRequestedActivate(); signal shortcutRequestedNewInstance(); + signal taskLauncherActivated(); + signal taskGroupedWindowAdded(); + signal taskGroupedWindowRemoved(); anchors.bottom: (parent && abilityItem.location === PlasmaCore.Types.BottomEdge) ? parent.bottom : undefined anchors.top: (parent && abilityItem.location === PlasmaCore.Types.TopEdge) ? parent.top : undefined @@ -117,6 +120,9 @@ Item{ readonly property real iconRotation: indicatorBackLayer.level.requested.iconRotation readonly property real iconScale: indicatorBackLayer.level.requested.iconScale + readonly property bool isIndicatorTaskLauncherAnimationRunning: (indicatorBackLayer.level.requested.isTaskLauncherAnimationRunning + || indicatorFrontLayer.level.requested.isTaskLauncherAnimationRunning) + readonly property alias indicator: abilityIndicatorObj readonly property alias parabolicItem: _parabolicItem readonly property alias restoreAnimation: _restoreAnimation diff --git a/declarativeimports/abilities/items/basicitem/IndicatorLevel.qml b/declarativeimports/abilities/items/basicitem/IndicatorLevel.qml index 10876bdf4..8ce160386 100644 --- a/declarativeimports/abilities/items/basicitem/IndicatorLevel.qml +++ b/declarativeimports/abilities/items/basicitem/IndicatorLevel.qml @@ -44,4 +44,11 @@ AbilityItem.IndicatorLevel { level.mouseReleased(Math.round(fixedPos.x), Math.round(fixedPos.y), button); } } + + Connections { + target: abilityItem + onTaskLauncherActivated: level.taskLauncherActivated(); + onTaskGroupedWindowAdded: level.taskGroupedWindowAdded(); + onTaskGroupedWindowRemoved: level.taskGroupedWindowRemoved(); + } } diff --git a/declarativeimports/abilities/items/indicators/LevelOptions.qml b/declarativeimports/abilities/items/indicators/LevelOptions.qml index 1c1f48d48..a2d44950e 100644 --- a/declarativeimports/abilities/items/indicators/LevelOptions.qml +++ b/declarativeimports/abilities/items/indicators/LevelOptions.qml @@ -9,6 +9,9 @@ Item { id: level signal mousePressed(int x, int y, int button); signal mouseReleased(int x, int y, int button); + signal taskLauncherActivated(); + signal taskGroupedWindowAdded(); + signal taskGroupedWindowRemoved(); property bool isBackground: true property bool isForeground: false @@ -22,6 +25,7 @@ Item { property real iconOpacity: 1.0 property real iconRotation: 0 property real iconScale: 1.0 + property bool isTaskLauncherAnimationRunning: false } property Item indicator: null diff --git a/declarativeimports/components/IndicatorItem.qml b/declarativeimports/components/IndicatorItem.qml index 23965924f..d278e7d4e 100644 --- a/declarativeimports/components/IndicatorItem.qml +++ b/declarativeimports/components/IndicatorItem.qml @@ -33,6 +33,22 @@ Item { //! indicator provides its own clicked animations. Latte should not provide //! any clicked animation in that case property bool providesClickedAnimation: false + //! indicator provides its own inattention animation. Latte should not provide + //! any inattention animation in that case. + //! [since v0.10.4] + property bool providesInAttentionAnimation: false + //! indicator provides its own window added in group animation. Latte should not provide + //! any window added in group animation in that case. + //! [since v0.10.4] + property bool providesGroupedWindowAddedAnimation: false + //! indicator provides its own window removed from group animation. Latte should not provide + //! any window removed from group animation in that case. + //! [since v0.10.4] + property bool providesGroupedWindowRemovedAnimation: false + //! indicator provides its own task launcher triggered animation. Latte should not provide + //! any task launcher triggered animation in that case. + //! [since v0.10.4] + property bool providesTaskLauncherAnimation: false //! this indicator will draw its own indicators for applets //! [since v0.10.0] @@ -75,7 +91,7 @@ Item { //! in order to reduce resources usage property var svgImagePaths: [] - //! Level Requested API reference + //! LEVEL.Requested API reference //! indicator requests different icon X offset from icon center //! [since v0.9.2] @@ -101,6 +117,11 @@ Item { //! [since v0.10.4] //property real level.requested.iconScale: 1.0 + //! indicator is playing a task launcher animation. It is used in combination with + //! providesTaskLauncherAnimation + //! [since v0.10.4] + //property bool level.requested.isTaskLauncherAnimationRunning: false + onLevelChanged: { if (level) { //! initialization on startup, this way when changing from indicator that changes them @@ -111,6 +132,7 @@ Item { level.requested.iconOpacity = 1.0; level.requested.iconRotation = 0; level.requested.iconScale = 1.0; + level.requested.isTaskLauncherAnimationRunning = false; } } } diff --git a/plasmoid/package/contents/ui/TasksExtendedManager.qml b/plasmoid/package/contents/ui/TasksExtendedManager.qml index c39f3799f..c4ad5f016 100644 --- a/plasmoid/package/contents/ui/TasksExtendedManager.qml +++ b/plasmoid/package/contents/ui/TasksExtendedManager.qml @@ -238,7 +238,7 @@ Item { arraysGarbageCollectorTimer.restart(); var frozenTaskExists = false; - console.log("SET FROZEN :: "+identifier+" - "+scale); + //console.log("SET FROZEN :: "+identifier+" - "+scale); var frozenTask = getFrozenTask(identifier); if (frozenTask) { diff --git a/plasmoid/package/contents/ui/task/TaskIcon.qml b/plasmoid/package/contents/ui/task/TaskIcon.qml index c54391cd4..b31669c1b 100644 --- a/plasmoid/package/contents/ui/task/TaskIcon.qml +++ b/plasmoid/package/contents/ui/task/TaskIcon.qml @@ -449,17 +449,6 @@ Item { removingAnimation.removingItem.destroy(); } - Connections{ - target: taskItem - - onInAttentionChanged:{ - if (!taskItem.inAttention && newWindowAnimation.running && taskItem.inAttentionAnimation) { - newWindowAnimation.pause(); - fastRestoreAnimation.start(); - } - } - } - //////////// States //////////////////// states: [ State{ diff --git a/plasmoid/package/contents/ui/task/TaskItem.qml b/plasmoid/package/contents/ui/task/TaskItem.qml index 41aa8b4c8..0ea64b8b4 100644 --- a/plasmoid/package/contents/ui/task/TaskItem.qml +++ b/plasmoid/package/contents/ui/task/TaskItem.qml @@ -28,12 +28,12 @@ AbilityItem.BasicItem { isHidden: !visible || isForcedHidden - isHiddenSpacerForcedShow: taskItem.inAttentionAnimation || taskItem.inFastRestoreAnimation + isHiddenSpacerForcedShow: taskItem.inAttentionBuiltinAnimation || taskItem.inFastRestoreAnimation isHiddenSpacerAnimated: taskItem.inFastRestoreAnimation || showWindowAnimation.running || root.inActivityChange || taskItem.inRemoveStage - || (taskItem.containsMouse && inAttentionAnimation && taskItem.parabolicItem.zoom!==taskItem.abilities.parabolic.factor.zoom) + || (taskItem.containsMouse && inAttentionBuiltinAnimation && taskItem.parabolicItem.zoom!==taskItem.abilities.parabolic.factor.zoom) isMonochromaticForcedContentItem: plasmoid.configuration.forceMonochromaticIcons monochromizedItem: taskIcon.monochromizedItem @@ -50,14 +50,14 @@ AbilityItem.BasicItem { return isWindow ? model.display : model.AppName; } - preserveIndicatorInInitialPosition: inBouncingAnimation || inAttentionAnimation || inNewWindowAnimation + preserveIndicatorInInitialPosition: inBouncingAnimation || inAttentionBuiltinAnimation || inNewWindowBuiltinAnimation parabolicItem.isParabolicEventBlocked: root.dragSource || !hoverEnabled || !taskItem.abilities.myView.isShownFully || inAnimation - || (inBlockingAnimation && !(inAttentionAnimation||inFastRestoreAnimation)) - parabolicItem.isUpdatingOnlySpacers: inAttentionAnimation || inBouncingAnimation + || (inBlockingAnimation && !(inAttentionBuiltinAnimation || inFastRestoreAnimation)) + parabolicItem.isUpdatingOnlySpacers: inAttentionBuiltinAnimation || inBouncingAnimation property alias hoverEnabled: taskMouseArea.hoverEnabled property alias pressed: taskMouseArea.pressed @@ -72,15 +72,17 @@ AbilityItem.BasicItem { /*animations flags*/ property bool inAnimation: true property bool inAddRemoveAnimation: true - property bool inAttentionAnimation: false + property bool inAttentionBuiltinAnimation: false property bool inBlockingAnimation: false property bool inBouncingAnimation: false property bool inFastRestoreAnimation: false - property bool inNewWindowAnimation: false + property bool inNewWindowBuiltinAnimation: false property bool inPopup: false property bool inRemoveStage: false - property bool isLauncherAnimationRunning: false + property bool isLauncherBuiltinAnimationRunning: false + property bool isLauncherAnimationRunning: isLauncherBuiltinAnimationRunning + || (taskItem.abilities.indicators.info.providesTaskLauncherAnimation && isIndicatorTaskLauncherAnimationRunning) //! after clicking to show/hide preview enter events are trigerred even though the should not property bool showPreviewsIsBlockedFromReleaseEvent: false @@ -107,6 +109,7 @@ AbilityItem.BasicItem { property bool hoveredFromDragging: (mouseHandler.hoveredItem === taskItem) || (mouseHandler.ignoredItem === taskItem) property bool wheelIsBlocked: false + property bool hasAddedWaitingLauncher: false property int badgeIndicator: 0 //it is used from external apps property int lastValidIndex: -1 //used for the removal animation @@ -246,9 +249,6 @@ AbilityItem.BasicItem { property QtObject contextMenu: null signal checkWindowsStates(); - signal groupWindowAdded(); - signal groupWindowRemoved(); - signal launcherAnimationRequested(); SubWindows{ id: subWindows @@ -264,13 +264,13 @@ AbilityItem.BasicItem { && (windowsCount > previousCount) && !(taskItem.containsMouse) && !root.dragSource ){ - taskItem.groupWindowAdded(); + taskItem.taskGroupedWindowAdded(); } else if ((windowsCount >= 1) && (windowsCount < previousCount) && !root.dragSource && !taskItem.delayingRemove){ //sometimes this is triggered in dragging with no reason - taskItem.groupWindowRemoved(); + taskItem.taskGroupedWindowRemoved(); } if (windowsCount>=1) { @@ -411,13 +411,23 @@ AbilityItem.BasicItem { subWindows.activateNextTask(); } + function activateLauncher() { + if (LatteCore.WindowSystem.compositingActive) { + taskItem.taskLauncherActivated(); + hasAddedWaitingLauncher = true; + tasksExtendedManager.addWaitingLauncher(taskItem.launcherUrl); + } + + if (root.disableAllWindowsFunctionality) { + tasksModel.requestNewInstance(modelIndex()); + } else { + tasksModel.requestActivate(modelIndex()); + } + } + function activateTask() { if( taskItem.isLauncher || root.disableAllWindowsFunctionality){ - if (LatteCore.WindowSystem.compositingActive) { - taskItem.launcherAnimationRequested(); - } else { - launcherAction(); - } + activateLauncher(); } else{ if (model.IsGroupParent) { var canPresentWindowsIsSupported = LatteCore.WindowSystem.compositingActive && (root.plasmaGreaterThan522 ? backend.canPresentWindows : backend.canPresentWindows()); @@ -523,20 +533,6 @@ AbilityItem.BasicItem { }); } - - function launcherAction(){ - if (LatteCore.WindowSystem.compositingActive) { - inBouncingAnimation = true; - tasksExtendedManager.addWaitingLauncher(taskItem.launcherUrl); - } - - if (root.disableAllWindowsFunctionality) { - tasksModel.requestNewInstance(modelIndex()); - } else { - tasksModel.requestActivate(modelIndex()); - } - } - ///window previews/// function generateSubText(task) { var subTextEntries = new Array(); @@ -696,7 +692,10 @@ AbilityItem.BasicItem { function slotWaitingLauncherRemoved(launch) { if ((isWindow || isStartup || isLauncher) && !visible && launch === launcherUrl) { - taskItem.parabolicItem.zoom = 1; + if (!taskItem.abilities.indicators.info.providesTaskLauncherAnimation) { + //! this is needed only from in-built launcher animation to restore zoom smoothly + taskItem.parabolicItem.zoom = 1; + } visible = true; } } diff --git a/plasmoid/package/contents/ui/task/TaskMouseArea.qml b/plasmoid/package/contents/ui/task/TaskMouseArea.qml index aa0e12691..e49a12d65 100644 --- a/plasmoid/package/contents/ui/task/TaskMouseArea.qml +++ b/plasmoid/package/contents/ui/task/TaskMouseArea.qml @@ -136,7 +136,7 @@ MouseArea { //console.log("Released Task Delegate..."); _resistanerTimer.stop(); - if(pressed && (!inBlockingAnimation || inAttentionAnimation) && !isSeparator){ + if(pressed && (!inBlockingAnimation || inAttentionBuiltinAnimation) && !isSeparator){ if (modifierAccepted(mouse) && !root.disableAllWindowsFunctionality){ if( !taskItem.isLauncher ){ @@ -250,7 +250,7 @@ MouseArea { scrollableList.decreasePos(); } else { if (isLauncher || root.disableAllWindowsFunctionality) { - taskItem.launcherAnimationRequested(); + taskItem.activateLauncher(); } else if (isGroupParent) { subWindows.activateNextTask(); } else { diff --git a/plasmoid/package/contents/ui/task/animations/LauncherAnimation.qml b/plasmoid/package/contents/ui/task/animations/LauncherAnimation.qml index 23e6fdb96..b609762e8 100644 --- a/plasmoid/package/contents/ui/task/animations/LauncherAnimation.qml +++ b/plasmoid/package/contents/ui/task/animations/LauncherAnimation.qml @@ -43,7 +43,7 @@ Item{ Binding { target: taskItem - property: "isLauncherAnimationRunning" + property: "isLauncherBuiltinAnimationRunning" value: running } @@ -89,25 +89,27 @@ Item{ } function startLauncherAnimation(){ - if(root.launcherBouncingEnabled){ + if (taskItem.abilities.indicators.info.providesTaskLauncherAnimation) { + return; + } + + if(root.launcherBouncingEnabled) { taskItem.animationStarted(); init(); launcherAnimationLoader.item.start(); - taskItem.launcherAction(); } else { launcherAnimationLoader.item.stop(); - taskItem.launcherAction(); } } Component.onCompleted: { - taskItem.launcherAnimationRequested.connect(startLauncherAnimation); + taskItem.taskLauncherActivated.connect(startLauncherAnimation); } Component.onDestruction: { clearAnimationsSignals(); - taskItem.launcherAnimationRequested.disconnect(startLauncherAnimation); + taskItem.taskLauncherActivated.disconnect(startLauncherAnimation); } } /////////////////// end of launcher animation diff --git a/plasmoid/package/contents/ui/task/animations/NewWindowAnimation.qml b/plasmoid/package/contents/ui/task/animations/NewWindowAnimation.qml index b83d0b140..0fdefd604 100644 --- a/plasmoid/package/contents/ui/task/animations/NewWindowAnimation.qml +++ b/plasmoid/package/contents/ui/task/animations/NewWindowAnimation.qml @@ -37,6 +37,17 @@ Item{ } } + Connections{ + target: taskItem + + onInAttentionChanged:{ + if (!taskItem.inAttention && newWindowAnimation.running && taskItem.inAttentionBuiltinAnimation) { + newWindowAnimation.pause(); + fastRestoreAnimation.start(); + } + } + } + function clear(){ newWindowAnimationLoader.item.stop(); @@ -44,8 +55,8 @@ Item{ taskItem.parabolicItem.zoomThickness = 1.0; taskItem.setBlockingAnimation(false); - taskItem.inAttentionAnimation = false; - taskItem.inNewWindowAnimation = false; + taskItem.inAttentionBuiltinAnimation = false; + taskItem.inNewWindowBuiltinAnimation = false; } function pause() { @@ -68,17 +79,23 @@ Item{ function init(){ taskItem.setBlockingAnimation(true); - taskItem.inNewWindowAnimation = true; + taskItem.inNewWindowBuiltinAnimation = true; taskItem.parabolicItem.zoomLength = taskItem.parabolicItem.zoom; taskItem.parabolicItem.zoomThickness = taskItem.parabolicItem.zoom; - taskItem.inAttentionAnimation = isDemandingAttention; + taskItem.inAttentionBuiltinAnimation = isDemandingAttention; taskItem.abilities.animations.needThickness.addEvent(needThicknessEvent); } function startNewWindowAnimation(){ + if (isDemandingAttention && taskItem.abilities.indicators.info.providesInAttentionAnimation) { + return; + } else if (!isDemandingAttention && taskItem.abilities.indicators.info.providesGroupedWindowAddedAnimation) { + return; + } + if (!taskItem.abilities.myView.isHidden && ((root.windowInAttentionEnabled && isDemandingAttention) || root.windowAddedInGroupEnabled)){ @@ -92,11 +109,11 @@ Item{ } Component.onCompleted: { - taskItem.groupWindowAdded.connect(startNewWindowAnimation); + taskItem.taskGroupedWindowAdded.connect(startNewWindowAnimation); } Component.onDestruction: { - taskItem.groupWindowAdded.disconnect(startNewWindowAnimation); + taskItem.taskGroupedWindowAdded.disconnect(startNewWindowAnimation); taskItem.abilities.animations.needThickness.removeEvent(needThicknessEvent); } } diff --git a/plasmoid/package/contents/ui/task/animations/RealRemovalAnimation.qml b/plasmoid/package/contents/ui/task/animations/RealRemovalAnimation.qml index 6f276a2ee..a5366bdee 100644 --- a/plasmoid/package/contents/ui/task/animations/RealRemovalAnimation.qml +++ b/plasmoid/package/contents/ui/task/animations/RealRemovalAnimation.qml @@ -109,6 +109,18 @@ SequentialAnimation { if (taskItem.parabolicItem.zoom > 1 && !taskRealRemovalAnimation.enabledAnimation && !taskItem.inBouncingAnimation && LatteCore.WindowSystem.compositingActive) { tasksExtendedManager.setFrozenTask(taskItem.launcherUrl, taskItem.parabolicItem.zoom); + } else { + //! remove frozen task if it is deprecated. This fixes the libreoffice launcher issue with custom indicator launcher animations, + //! steps to reproduce: + //! 1. set an indicator that provides its own launcher animation such as "Animated Dot" + //! 2. enable parabolic effect zoom + //! 3. click on libreoffice writer launcher and keep the mouse inside the launcher + //! 4. close libreoffice writer window from its decoration close button + //! 5. libreoffice writer launcher is zoomed even though it should not + var frozenTask = tasksExtendedManager.getFrozenTask(taskItem.launcherUrl); + if (frozenTask && frozenTask.zoom>1) { + tasksExtendedManager.removeFrozenTask(taskItem.launcherUrl); + } } if (taskItem.isLauncherAnimationRunning && !taskItem.isSeparator) { @@ -195,9 +207,13 @@ SequentialAnimation { taskItem.visible = false; //send signal that the launcher is really removing - if (taskItem.inBouncingAnimation) { + if (taskItem.hasAddedWaitingLauncher) { tasksExtendedManager.removeWaitingLauncher(taskItem.launcherUrl); - taskItem.abilities.parabolic.setDirectRenderingEnabled(false); + + if (!taskItem.abilities.indicators.info.providesTaskLauncherAnimation) { + //! this is needed only from in-built launcher animation to restore zoom smoothly to neighbour tasks + taskItem.abilities.parabolic.setDirectRenderingEnabled(false); + } } } } diff --git a/plasmoid/package/contents/ui/task/animations/RemoveWindowFromGroupAnimation.qml b/plasmoid/package/contents/ui/task/animations/RemoveWindowFromGroupAnimation.qml index a1aeae38f..0beadf1ce 100644 --- a/plasmoid/package/contents/ui/task/animations/RemoveWindowFromGroupAnimation.qml +++ b/plasmoid/package/contents/ui/task/animations/RemoveWindowFromGroupAnimation.qml @@ -29,17 +29,21 @@ Item{ } function removeTask(){ + if (taskItem.abilities.indicators.info.providesGroupedWindowRemovedAnimation) { + return; + } + if(!taskIconContainer.toBeDestroyed && root.windowRemovedFromGroupEnabled){ removingAnimation.init(); } } Component.onCompleted: { - taskItem.groupWindowRemoved.connect(removeTask); + taskItem.taskGroupedWindowRemoved.connect(removeTask); } Component.onDestruction: { - taskItem.groupWindowRemoved.disconnect(removeTask); + taskItem.taskGroupedWindowRemoved.disconnect(removeTask); } ///////////// Component for animating removing window from group diff --git a/plasmoid/package/contents/ui/task/animations/ShowWindowAnimation.qml b/plasmoid/package/contents/ui/task/animations/ShowWindowAnimation.qml index d5e83b679..f44453760 100644 --- a/plasmoid/package/contents/ui/task/animations/ShowWindowAnimation.qml +++ b/plasmoid/package/contents/ui/task/animations/ShowWindowAnimation.qml @@ -77,7 +77,7 @@ SequentialAnimation{ if(taskItem.isWindow || taskItem.isStartup){ publishGeometryTimer.start(); if (taskItem.isDemandingAttention){ - taskItem.groupWindowAdded(); + taskItem.taskGroupedWindowAdded(); } } taskItem.inAnimation = false; @@ -171,7 +171,7 @@ SequentialAnimation{ taskItem.parabolicItem.zoomThickness = 1.0; } - //! by enabling it we break the bouncing animation + //! by enabling it we break the bouncing animation and the indicators launchers animations //taskItem.visible = true; taskItem.parabolicItem.opacity = 1; taskItem.inAnimation = false; diff --git a/plasmoid/package/contents/ui/task/animations/newwindow/BounceAnimation.qml b/plasmoid/package/contents/ui/task/animations/newwindow/BounceAnimation.qml index f475da1f9..e53f440e2 100644 --- a/plasmoid/package/contents/ui/task/animations/newwindow/BounceAnimation.qml +++ b/plasmoid/package/contents/ui/task/animations/newwindow/BounceAnimation.qml @@ -27,7 +27,7 @@ SequentialAnimation{ duration: newWindowAnimation.speed easing.type: Easing.OutQuad - property real thickPercentage: taskItem.inAttentionAnimation ? 0.8 : 0.6 + property real thickPercentage: taskItem.inAttentionBuiltinAnimation ? 0.8 : 0.6 } PropertyAnimation { diff --git a/shell/package/contents/configuration/pages/TasksConfig.qml b/shell/package/contents/configuration/pages/TasksConfig.qml index 094126e4e..49f6f7e63 100644 --- a/shell/package/contents/configuration/pages/TasksConfig.qml +++ b/shell/package/contents/configuration/pages/TasksConfig.qml @@ -288,6 +288,7 @@ PlasmaComponents.Page { Layout.maximumWidth: dialog.optionsWidth text: i18n("Bounce launchers when triggered") value: tasks.configuration.animationLauncherBouncing + enabled: !latteView.indicator.info.providesTaskLauncherAnimation onClicked: { tasks.configuration.animationLauncherBouncing = !tasks.configuration.animationLauncherBouncing; @@ -298,6 +299,7 @@ PlasmaComponents.Page { Layout.maximumWidth: dialog.optionsWidth text: i18n("Bounce tasks that need attention") value: tasks.configuration.animationWindowInAttention + enabled: !latteView.indicator.info.providesInAttentionAnimation onClicked: { tasks.configuration.animationWindowInAttention = !tasks.configuration.animationWindowInAttention; @@ -318,6 +320,7 @@ PlasmaComponents.Page { Layout.maximumWidth: dialog.optionsWidth text: i18n("Grouped tasks bounce their new windows") value: tasks.configuration.animationWindowAddedInGroup + enabled: !latteView.indicator.info.providesGroupedWindowAddedAnimation onClicked: { tasks.configuration.animationWindowAddedInGroup = !tasks.configuration.animationWindowAddedInGroup; @@ -328,6 +331,7 @@ PlasmaComponents.Page { Layout.maximumWidth: dialog.optionsWidth text: i18n("Grouped tasks slide out their closed windows") value: tasks.configuration.animationWindowRemovedFromGroup + enabled: !latteView.indicator.info.providesGroupedWindowRemovedAnimation onClicked: { tasks.configuration.animationWindowRemovedFromGroup = !tasks.configuration.animationWindowRemovedFromGroup;