| 1199 | } |
| 1200 | |
| 1201 | void 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 | |
| 1226 | bool MainWidget::chatBackgroundLoading() { |
| 1227 | return (_background != nullptr); |
nothing calls this directly
no test coverage detected