Warning, /plasma/latte-dock/plasmoid/package/contents/ui/task/animations/newwindow/BounceAnimation.qml is written in an unsupported language. File is not indexed.
0001 /*
0002 SPDX-FileCopyrightText: 2020 Michail Vourlakos <mvourlakos@gmail.com>
0003 SPDX-License-Identifier: GPL-2.0-or-later
0004 */
0005
0006 import QtQuick 2.0
0007
0008 import org.kde.plasma.plasmoid 2.0
0009
0010 SequentialAnimation{
0011 loops: newWindowAnimation.isDemandingAttention ? 20 : 1
0012
0013 readonly property string bouncePropertyName: taskItem.isVertical ? "iconAnimatedOffsetX" : "iconAnimatedOffsetY"
0014
0015 Component.onCompleted: {
0016 if (newWindowAnimation.inDelayedStartup) {
0017 newWindowAnimation.inDelayedStartup = false;
0018 newWindowAnimation.init();
0019 start();
0020 }
0021 }
0022
0023 Component.onDestruction: {
0024 //! make sure to return on initial position even when the animation is destroyed in the middle
0025 if (taskItem.isVertical) {
0026 taskItem.iconAnimatedOffsetX = 0;
0027 } else {
0028 taskItem.iconAnimatedOffsetY = 0;
0029 }
0030 }
0031
0032 PropertyAnimation {
0033 target: taskItem
0034 property: bouncePropertyName
0035 to: 0.6 * taskItem.abilities.metrics.iconSize
0036 duration: newWindowAnimation.speed
0037 easing.type: Easing.OutQuad
0038 }
0039
0040 PropertyAnimation {
0041 target: taskItem
0042 property: bouncePropertyName
0043 to: 0
0044 duration: 4.4*newWindowAnimation.speed
0045 easing.type: Easing.OutBounce
0046 }
0047
0048 onStopped: {
0049 //! make sure to return on initial position even when the animation is destroyed in the middle
0050 if (taskItem.isVertical) {
0051 taskItem.iconAnimatedOffsetX = 0;
0052 } else {
0053 taskItem.iconAnimatedOffsetY = 0;
0054 }
0055 }
0056 }