| 558 | } |
| 559 | |
| 560 | void 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 | |
| 595 | bool MainWindow::markingAsRead() const { |
| 596 | return _main |
nothing calls this directly
no test coverage detected