MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / showEmailInput

Method showEmailInput

Telegram/SourceFiles/window/window_setup_email.cpp:340–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

338}
339
340void 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
383QPixmap SetupEmailLockWidget::grabContent() {
384 return Ui::GrabWidget(this);

Callers

nothing calls this directly

Calls 10

setFinishedCallbackMethod · 0.80
setPixmapsMethod · 0.80
updateFunction · 0.50
hideMethod · 0.45
showMethod · 0.45
setDirectionMethod · 0.45
setRepaintCallbackMethod · 0.45
resetMethod · 0.45
startMethod · 0.45
setFocusMethod · 0.45

Tested by

no test coverage detected