diff --git a/panels/notification/bubble/bubblepanel.cpp b/panels/notification/bubble/bubblepanel.cpp index f9ecc9439..4a100d0d9 100644 --- a/panels/notification/bubble/bubblepanel.cpp +++ b/panels/notification/bubble/bubblepanel.cpp @@ -12,6 +12,7 @@ #include #include +#include namespace notification { Q_DECLARE_LOGGING_CATEGORY(notifyLog) @@ -110,7 +111,14 @@ void BubblePanel::onNotificationStateChanged(qint64 id, int processedType) void BubblePanel::onBubbleCountChanged() { bool isEmpty = m_bubbles->items().isEmpty(); - setVisible(!isEmpty && enabled()); + const bool visible = !isEmpty && enabled(); + if (!visible) { + QTimer::singleShot(400, this, [this]() { + setVisible(false); + }); + } else { + setVisible(visible); + } } void BubblePanel::addBubble(qint64 id) diff --git a/panels/notification/bubble/package/main.qml b/panels/notification/bubble/package/main.qml index 80ccac395..c948038b2 100644 --- a/panels/notification/bubble/package/main.qml +++ b/panels/notification/bubble/package/main.qml @@ -92,7 +92,7 @@ Window { ListView { id: bubbleView width: 360 - height: contentHeight + height: Math.max(contentHeight, childrenRect.height) anchors { right: parent.right bottom: parent.bottom @@ -128,6 +128,30 @@ Window { easing.type: Easing.OutExpo } } + + remove: Transition { + SequentialAnimation { + PropertyAction { + property: "ListView.delayRemove" + value: true + } + + ParallelAnimation { + NumberAnimation { + property: "x" + to: 360 + duration: 400 + easing.type: Easing.InExpo + } + } + + PropertyAction { + property: "ListView.delayRemove" + value: false + } + } + } + delegate: Bubble { width: 360 bubble: model