Skip to content

Commit c22b928

Browse files
committed
fix: improve notification bubble panel hide animation
Changed the bubble panel visibility logic to include a 400ms delay before hiding when there are no notifications. This prevents the panel from disappearing abruptly when the last bubble is removed. The QML ListView now includes a remove transition with smooth exit animation for bubbles. Added QTimer include for delayed hide functionality. Modified the ListView height calculation to use maximum of contentHeight and childrenRect.height to ensure proper layout during animations. Implemented a sequential animation for bubble removal with x-axis slide- out effect. Log: Improved notification bubble animations with smoother hide effects Influence: 1. Test notification bubble appearance and disappearance 2. Verify panel remains visible during bubble removal animations 3. Check that multiple bubbles animate correctly 4. Test edge cases with rapid notification additions/removals 5. Verify panel properly hides after all bubbles are removed 6. Test animation timing and smoothness PMS: BUG-284659
1 parent dcdd974 commit c22b928

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

panels/notification/bubble/bubblepanel.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <QQueue>
1313

1414
#include <appletbridge.h>
15+
#include <qtimer.h>
1516

1617
namespace notification {
1718
Q_DECLARE_LOGGING_CATEGORY(notifyLog)
@@ -110,7 +111,14 @@ void BubblePanel::onNotificationStateChanged(qint64 id, int processedType)
110111
void BubblePanel::onBubbleCountChanged()
111112
{
112113
bool isEmpty = m_bubbles->items().isEmpty();
113-
setVisible(!isEmpty && enabled());
114+
const bool visible = !isEmpty && enabled();
115+
if (!visible) {
116+
QTimer::singleShot(400, this, [this]() {
117+
setVisible(false);
118+
});
119+
} else {
120+
setVisible(visible);
121+
}
114122
}
115123

116124
void BubblePanel::addBubble(qint64 id)

panels/notification/bubble/package/Bubble.qml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,27 @@ Control {
1212
id: control
1313
height: loader.height
1414
property var bubble
15+
16+
ListView.onRemove: SequentialAnimation {
17+
PropertyAction {
18+
target: control
19+
property: "ListView.delayRemove"
20+
value: true
21+
}
22+
NumberAnimation {
23+
target: control
24+
property: "x"
25+
to: 360
26+
duration: 400
27+
easing.type: Easing.InExpo
28+
}
29+
PropertyAction {
30+
target: control
31+
property: "ListView.delayRemove"
32+
value: false
33+
}
34+
}
35+
1536
onHoveredChanged: function () {
1637
if (control.hovered) {
1738
Applet.bubbles.delayRemovedBubble = bubble.id

0 commit comments

Comments
 (0)