| 84 | } |
| 85 | |
| 86 | void ToastNotification::showAnimated() { |
| 87 | // The target is the position ToastManager already move()d us to. |
| 88 | const QPoint end_pos = pos(); |
| 89 | |
| 90 | QPoint start_pos = end_pos; |
| 91 | start_pos.setX(end_pos.x() + width() + 50); |
| 92 | |
| 93 | move(start_pos); |
| 94 | show(); |
| 95 | |
| 96 | slide_animation_->setStartValue(start_pos); |
| 97 | slide_animation_->setEndValue(end_pos); |
| 98 | slide_animation_->start(); |
| 99 | |
| 100 | // Only start the auto-dismiss countdown once the entrance finishes. |
| 101 | if (timeout_timer_ && timeout_ms_ > 0) { |
| 102 | QTimer::singleShot(kAnimationDurationMs, this, [this]() { |
| 103 | if (timeout_timer_ && !is_closing_) { |
| 104 | timeout_timer_->start(timeout_ms_); |
| 105 | } |
| 106 | }); |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | void ToastNotification::hideAnimated() { |
| 111 | if (is_closing_) { |