| 338 | } |
| 339 | |
| 340 | void SetupEmailLockWidget::showEmailInput() { |
| 341 | if (!_confirmWidget) { |
| 342 | return; |
| 343 | } |
| 344 | |
| 345 | auto oldContentCache = Ui::GrabWidget(_confirmWidget); |
| 346 | _confirmWidget->hide(); |
| 347 | _confirmWidget->deleteLater(); |
| 348 | _confirmWidget = nullptr; |
| 349 | |
| 350 | if (_logoutButton) { |
| 351 | _logoutButton->show(); |
| 352 | } |
| 353 | _layout->show(); |
| 354 | auto newContentCache = grabContent(); |
| 355 | if (_logoutButton) { |
| 356 | _logoutButton->hide(); |
| 357 | } |
| 358 | _layout->hide(); |
| 359 | |
| 360 | _backAnimation = std::make_unique<SlideAnimation>(); |
| 361 | _backAnimation->setDirection(SlideDirection::FromLeft); |
| 362 | _backAnimation->setRepaintCallback([=] { update(); }); |
| 363 | _backAnimation->setFinishedCallback([=] { |
| 364 | _layout->show(); |
| 365 | if (_logoutButton) { |
| 366 | _logoutButton->show(); |
| 367 | } |
| 368 | _backAnimation.reset(); |
| 369 | if (_iconAnimate) { |
| 370 | _iconAnimate(anim::repeat::once); |
| 371 | } |
| 372 | }); |
| 373 | _backAnimation->setPixmaps( |
| 374 | std::move(oldContentCache), |
| 375 | std::move(newContentCache)); |
| 376 | _backAnimation->start(); |
| 377 | |
| 378 | if (_emailInput) { |
| 379 | _emailInput->setFocus(); |
| 380 | } |
| 381 | } |
| 382 | |
| 383 | QPixmap SetupEmailLockWidget::grabContent() { |
| 384 | return Ui::GrabWidget(this); |
nothing calls this directly
no test coverage detected