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

Method setReadyChatBackground

Telegram/SourceFiles/mainwidget.cpp:1201–1224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1199}
1200
1201void MainWidget::setReadyChatBackground(
1202 const Data::WallPaper &background,
1203 QImage &&image) {
1204 using namespace Window::Theme;
1205
1206 if (image.isNull()
1207 && !background.document()
1208 && background.localThumbnail()) {
1209 image = background.localThumbnail()->original();
1210 }
1211
1212 const auto resetToDefault = image.isNull()
1213 && !background.document()
1214 && background.backgroundColors().empty()
1215 && !Data::IsLegacy1DefaultWallPaper(background);
1216 const auto ready = resetToDefault
1217 ? Data::DefaultWallPaper()
1218 : background;
1219
1220 Background()->set(ready, std::move(image));
1221 const auto tile = Data::IsLegacy1DefaultWallPaper(ready);
1222 Background()->setTile(tile);
1223 Ui::ForceFullRepaint(this);
1224}
1225
1226bool MainWidget::chatBackgroundLoading() {
1227 return (_background != nullptr);

Callers

nothing calls this directly

Calls 11

DefaultWallPaperFunction · 0.85
localThumbnailMethod · 0.80
originalMethod · 0.80
backgroundColorsMethod · 0.80
setTileMethod · 0.80
BackgroundFunction · 0.50
isNullMethod · 0.45
documentMethod · 0.45
emptyMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected