From d9589898ea8cdba8317c45f0d2c5fedee48f9d95 Mon Sep 17 00:00:00 2001 From: zhaoyingzhen Date: Wed, 21 Aug 2024 17:27:54 +0800 Subject: [PATCH] Revert "chore: Reimplement notification animation" This reverts commit 2f8de937 --- debian/changelog | 6 + panels/dock/taskmanager/package/AppItem.qml | 81 ++++--------- .../taskmanager/package/BeatAnimation.qml | 110 ++++++++++++++++++ .../dock/taskmanager/package/TaskManager.qml | 1 - 4 files changed, 136 insertions(+), 62 deletions(-) create mode 100644 panels/dock/taskmanager/package/BeatAnimation.qml diff --git a/debian/changelog b/debian/changelog index ba152bb92..01a900835 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dde-shell (0.0.43) unstable; urgency=medium + + * bump version to 0.0.43 + + -- Deepin Packages Builder Thu, 29 Aug 2024 10:27:53 +0800 + dde-shell (0.0.42) unstable; urgency=medium * feat: tooltip and preview call to treeland diff --git a/panels/dock/taskmanager/package/AppItem.qml b/panels/dock/taskmanager/package/AppItem.qml index b3a851a16..c5fb133c5 100644 --- a/panels/dock/taskmanager/package/AppItem.qml +++ b/panels/dock/taskmanager/package/AppItem.qml @@ -165,7 +165,14 @@ Item { name: root.iconName sourceSize: Qt.size(Dock.MAX_DOCK_TASKMANAGER_ICON_SIZE, Dock.MAX_DOCK_TASKMANAGER_ICON_SIZE) anchors.centerIn: parent - scale: Panel.rootObject.isDragging ? iconScale : iconScale + scale: iconScale + BeatAnimation { + id: beatAnimation + target: icon + baseScale: iconScale + loops: Animation.Infinite + running: root.attention + } LaunchAnimation { id: launchAnimation @@ -197,68 +204,20 @@ Item { loops: 1 running: false } - } - - // TODO: value can set during debugPanel - Repeater { - model: 5 - Rectangle { - id: rect - required property int index - property var originSize: Dock.MAX_DOCK_TASKMANAGER_ICON_SIZE * 1.2 * iconScale - - visible: root.attention && !Panel.rootObject.isDragging - width: originSize * (index - 1) - height: width - radius: width / 2 - color: Qt.rgba(1, 1, 1, 0.1) - - anchors.centerIn: icon - z: -1 - opacity: Math.min(3 - width / originSize, blendColorAlpha(D.DTK.themeType === D.ApplicationHelper.DarkType ? 0.25 : 1.0)) - - function blendColorAlpha(fallback) { - var appearance = DS.applet("org.deepin.ds.dde-appearance") - if (!appearance || appearance.opacity < 0 || appearance.opacity > fallback || appearance.opacity < fallback) - return fallback - return appearance.opacity - } - - SequentialAnimation { - running: root.attention && !Panel.rootObject.isDragging - loops: Animation.Infinite - // 弹出 - ParallelAnimation { - NumberAnimation { target: rect; property: "width"; from: Math.max(originSize * (index - 1), 0); to: originSize * (index); duration: 1200 } - ColorAnimation { target: rect; property: "color"; from: Qt.rgba(1, 1, 1, 0.4); to: Qt.rgba(1, 1, 1, 0.1); duration: 1200 } - NumberAnimation { target: icon; property: "scale"; from: iconScale; to: iconScale * 1.15; duration: 1200; easing.type: Easing.OutElastic; easing.amplitude: 1; easing.period: 0.2 } + Connections { + target: Panel.rootObject + function onPressedAndDragging(isDragging) { + if (isDragging) { + beatAnimation.stop() + icon.scale = Qt.binding(function() { + return root.iconScale + }) + } else { + beatAnimation.running = Qt.binding(function() { + return root.attention + }) } - - // 收缩 - ParallelAnimation { - NumberAnimation { target: rect; property: "width"; from: originSize * (index); to: originSize * (index + 1); duration: 1200 } - ColorAnimation { target: rect; property: "color"; from: Qt.rgba(1, 1, 1, 0.4); to: Qt.rgba(1, 1, 1, 0.1); duration: 1200 } - NumberAnimation { target: icon; property: "scale"; from: iconScale * 1.15; to: iconScale; duration: 1200; easing.type: Easing.OutElastic; easing.amplitude: 1; easing.period: 0.2 } - } - - // 停顿 - ParallelAnimation { - NumberAnimation { target: rect; property: "width"; from: originSize * (index + 1); to: originSize * (index + 2); duration: 1200 } - ColorAnimation { target: rect; property: "color"; from: Qt.rgba(1, 1, 1, 0.4); to: Qt.rgba(1, 1, 1, 0.1); duration: 1200 } - } - } - - D.BoxShadow { - visible: rect.visible - anchors.fill: rect - z: -2 - shadowBlur: 20 - shadowColor : Qt.rgba(0, 0, 0, 0.05) - shadowOffsetX : 0 - shadowOffsetY : 0 - cornerRadius: rect.radius - hollow: true } } } diff --git a/panels/dock/taskmanager/package/BeatAnimation.qml b/panels/dock/taskmanager/package/BeatAnimation.qml new file mode 100644 index 000000000..c49f27da4 --- /dev/null +++ b/panels/dock/taskmanager/package/BeatAnimation.qml @@ -0,0 +1,110 @@ +// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. +// +// SPDX-License-Identifier: GPL-3.0-or-later + +import QtQuick 2.15 + +SequentialAnimation { + property Item target: parent + id: root + property real baseScale + + PropertyAnimation { + target: root.target + property: "scale" + from: baseScale + to: baseScale + duration: 880 + } + + PropertyAnimation { + target: root.target + property: "scale" + from: baseScale + to: baseScale * 1.2 + duration: 120 + } + + PropertyAnimation { + target: root.target + property: "scale" + from: baseScale * 1.2 + to: baseScale * 1.08 + duration: 80 + } + + PropertyAnimation { + target: root.target + property: "scale" + from: baseScale * 1.08 + to: baseScale * 1.16 + duration: 120 + } + + PropertyAnimation { + target: root.target + property: "scale" + from: baseScale * 1.16 + to: baseScale * 1.1 + duration: 120 + } + + PropertyAnimation { + target: root.target + property: "scale" + from: baseScale * 1.1 + to: baseScale * 1.15 + duration: 120 + } + + PropertyAnimation { + target: root.target + property: "scale" + from: baseScale * 1.15 + to: baseScale * 1.12 + duration: 120 + } + + PropertyAnimation { + target: root.target + property: "scale" + from: baseScale * 1.12 + to: baseScale * 0.9 + duration: 160 + } + + PropertyAnimation { + target: root.target + property: "scale" + from: baseScale * 0.9 + to: baseScale * 1.05 + duration: 120 + } + + PropertyAnimation { + target: root.target + property: "scale" + from: baseScale * 1.05 + to: baseScale * 0.95 + duration: 120 + } + + PropertyAnimation { + target: root.target + property: "scale" + from: baseScale * 0.95 + to: baseScale * 1 + duration: 120 + } + + PropertyAnimation { + target: root.target + property: "scale" + from: baseScale * 1 + to: baseScale * 1 + duration: 480 + } + + onStopped: root.target.scale = baseScale + onFinished: loops = Animation.Infinite +} diff --git a/panels/dock/taskmanager/package/TaskManager.qml b/panels/dock/taskmanager/package/TaskManager.qml index 4e23f4652..4270be2a3 100644 --- a/panels/dock/taskmanager/package/TaskManager.qml +++ b/panels/dock/taskmanager/package/TaskManager.qml @@ -58,7 +58,6 @@ ContainmentItem { required property string menus required property list windows keys: ["text/x-dde-dock-dnd-appid"] - z: attention ? -1 : 0 property bool visibility: itemId !== launcherDndDropArea.launcherDndDesktopId states: [