| 108 | } |
| 109 | |
| 110 | void ToastNotification::hideAnimated() { |
| 111 | if (is_closing_) { |
| 112 | return; |
| 113 | } |
| 114 | is_closing_ = true; |
| 115 | |
| 116 | if (timeout_timer_) { |
| 117 | timeout_timer_->stop(); |
| 118 | } |
| 119 | |
| 120 | QPoint start_pos = pos(); |
| 121 | QPoint end_pos = start_pos; |
| 122 | end_pos.setX(start_pos.x() + width() + 50); |
| 123 | |
| 124 | slide_animation_->setStartValue(start_pos); |
| 125 | slide_animation_->setEndValue(end_pos); |
| 126 | slide_animation_->start(); |
| 127 | } |
| 128 | |
| 129 | QString ToastNotification::message() const { |
| 130 | return message_label_->text(); |