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

Method themeUpdated

Telegram/SourceFiles/mainwindow.cpp:560–593  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

558}
559
560void MainWindow::themeUpdated(const Window::Theme::BackgroundUpdate &data) {
561 using Type = Window::Theme::BackgroundUpdate::Type;
562
563 // We delay animating theme warning because we want all other
564 // subscribers to receive palette changed notification before any
565 // animations (that include pixmap caches with old palette values).
566 if (data.type == Type::TestingTheme) {
567 if (!_testingThemeWarning) {
568 _testingThemeWarning.create(bodyWidget());
569 _testingThemeWarning->hide();
570 _testingThemeWarning->setGeometry(rect());
571 _testingThemeWarning->setHiddenCallback([this] { _testingThemeWarning.destroyDelayed(); });
572 }
573 crl::on_main(this, [=] {
574 if (_testingThemeWarning) {
575 _testingThemeWarning->showAnimated();
576 }
577 });
578 } else if (data.type == Type::RevertingTheme || data.type == Type::ApplyingTheme) {
579 if (_testingThemeWarning) {
580 if (_testingThemeWarning->isHidden()) {
581 _testingThemeWarning.destroy();
582 } else {
583 crl::on_main(this, [=] {
584 if (_testingThemeWarning) {
585 _testingThemeWarning->hideAnimated();
586 _testingThemeWarning = nullptr;
587 }
588 setInnerFocus();
589 });
590 }
591 }
592 }
593}
594
595bool MainWindow::markingAsRead() const {
596 return _main

Callers

nothing calls this directly

Calls 8

createMethod · 0.45
hideMethod · 0.45
setGeometryMethod · 0.45
setHiddenCallbackMethod · 0.45
showAnimatedMethod · 0.45
isHiddenMethod · 0.45
destroyMethod · 0.45
hideAnimatedMethod · 0.45

Tested by

no test coverage detected