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

Method setChatBackground

Telegram/SourceFiles/mainwidget.cpp:1172–1193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1170}
1171
1172void MainWidget::setChatBackground(
1173 const Data::WallPaper &background,
1174 QImage &&image) {
1175 using namespace Window::Theme;
1176
1177 if (isReadyChatBackground(background, image)) {
1178 setReadyChatBackground(background, std::move(image));
1179 return;
1180 }
1181
1182 _background = std::make_unique<SettingBackground>(background);
1183 if (const auto document = _background->data.document()) {
1184 _background->dataMedia = document->createMediaView();
1185 _background->dataMedia->thumbnailWanted(
1186 _background->data.fileOrigin());
1187 }
1188 _background->data.loadDocument();
1189 checkChatBackground();
1190
1191 const auto tile = Data::IsLegacy1DefaultWallPaper(background);
1192 Window::Theme::Background()->downloadingStarted(tile);
1193}
1194
1195bool MainWidget::isReadyChatBackground(
1196 const Data::WallPaper &background,

Callers 1

applyForEveryoneMethod · 0.80

Calls 8

thumbnailWantedMethod · 0.80
loadDocumentMethod · 0.80
downloadingStartedMethod · 0.80
BackgroundFunction · 0.50
documentMethod · 0.45
createMediaViewMethod · 0.45
fileOriginMethod · 0.45

Tested by

no test coverage detected