diff --git a/panels/notification/bubble/bubblepanel.cpp b/panels/notification/bubble/bubblepanel.cpp index f9ecc9439..f643b7833 100644 --- a/panels/notification/bubble/bubblepanel.cpp +++ b/panels/notification/bubble/bubblepanel.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -8,6 +8,7 @@ #include "dataaccessorproxy.h" #include "pluginfactory.h" +#include #include #include @@ -110,7 +111,13 @@ void BubblePanel::onNotificationStateChanged(qint64 id, int processedType) void BubblePanel::onBubbleCountChanged() { bool isEmpty = m_bubbles->items().isEmpty(); - setVisible(!isEmpty && enabled()); + if (isEmpty) { + QTimer::singleShot(400, this, [this]() { + setVisible(false); + }); + } else { + setVisible(!isEmpty && enabled()); + } } void BubblePanel::addBubble(qint64 id) diff --git a/panels/notification/bubble/package/main.qml b/panels/notification/bubble/package/main.qml index 80ccac395..342a14169 100644 --- a/panels/notification/bubble/package/main.qml +++ b/panels/notification/bubble/package/main.qml @@ -129,8 +129,29 @@ Window { } } delegate: Bubble { + id: delegateItem width: 360 bubble: model + + ListView.onRemove: SequentialAnimation { + PropertyAction { + target: delegateItem + property: "ListView.delayRemove" + value: true + } + NumberAnimation { + target: delegateItem + property: "x" + to: 360 + duration: 400 + easing.type: Easing.InExpo + } + PropertyAction { + target: delegateItem + property: "ListView.delayRemove" + value: false + } + } } } }