| 309 | } // namespace |
| 310 | |
| 311 | void StartFireworks(not_null<QWidget*> parent) { |
| 312 | const auto result = Ui::CreateChild<RpWidget>(parent.get()); |
| 313 | result->setAttribute(Qt::WA_TransparentForMouseEvents); |
| 314 | result->setGeometry(parent->rect()); |
| 315 | result->show(); |
| 316 | |
| 317 | auto &lifetime = result->lifetime(); |
| 318 | const auto animation = lifetime.make_state<FireworksAnimation>([=] { |
| 319 | result->update(); |
| 320 | }); |
| 321 | result->paintRequest() | rpl::on_next([=] { |
| 322 | auto p = QPainter(result); |
| 323 | if (!animation->paint(p, result->rect())) { |
| 324 | crl::on_main(result, [=] { delete result; }); |
| 325 | } |
| 326 | }, lifetime); |
| 327 | } |
| 328 | |
| 329 | void BoostBox( |
| 330 | not_null<GenericBox*> box, |
no test coverage detected