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

Method Inner

Telegram/SourceFiles/boxes/background_box.cpp:380–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

378}
379
380BackgroundBox::Inner::Inner(
381 QWidget *parent,
382 not_null<Main::Session*> session,
383 PeerData *forPeer)
384: RpWidget(parent)
385, _session(session)
386, _forPeer(forPeer)
387, _api(&_session->mtp())
388, _check(
389 std::make_unique<Ui::RoundCheckbox>(
390 st::overviewCheck,
391 [=] { update(); })) {
392 _check->setChecked(true, anim::type::instant);
393 resize(
394 st::boxWideWidth,
395 (2 * (st::backgroundSize.height() + st::backgroundPadding)
396 + st::backgroundPadding));
397
398 Window::Theme::IsNightModeValue(
399 ) | rpl::on_next([=] {
400 updatePapers();
401 }, lifetime());
402 requestPapers();
403
404 _session->downloaderTaskFinished(
405 ) | rpl::on_next([=] {
406 update();
407 }, lifetime());
408
409 style::PaletteChanged(
410 ) | rpl::on_next([=] {
411 _check->invalidateCache();
412 }, lifetime());
413
414 if (forChannel()) {
415 _session->data().cloudThemes().chatThemesUpdated(
416 ) | rpl::on_next([=] {
417 updatePapers();
418 }, lifetime());
419 } else {
420 using Update = Window::Theme::BackgroundUpdate;
421 Window::Theme::Background()->updates(
422 ) | rpl::on_next([=](const Update &update) {
423 if (update.type == Update::Type::New) {
424 sortPapers();
425 requestPapers();
426 this->update();
427 }
428 }, lifetime());
429 }
430
431 setMouseTracking(true);
432}
433
434void BackgroundBox::Inner::requestPapers() {
435 if (forChannel()) {

Callers

nothing calls this directly

Calls 12

IsNightModeValueFunction · 0.85
PaletteChangedFunction · 0.85
chatThemesUpdatedMethod · 0.80
updateFunction · 0.50
BackgroundFunction · 0.50
setCheckedMethod · 0.45
heightMethod · 0.45
invalidateCacheMethod · 0.45
dataMethod · 0.45
updatesMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected