2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Update default chat background.

This commit is contained in:
John Preston
2021-08-31 22:10:39 +03:00
parent d29a1f5cd2
commit f59db10267
11 changed files with 110 additions and 47 deletions

View File

@@ -4054,10 +4054,18 @@ void Session::setWallpapers(const QVector<MTPWallPaper> &data, int32 hash) {
ranges::rotate(begin(_wallpapers), legacy2, legacy2 + 1);
}
// Put the legacy3 (static gradient) wallpaper to the front of the list.
const auto legacy3 = ranges::find_if(
_wallpapers,
Data::IsLegacy3DefaultWallPaper);
if (legacy3 != end(_wallpapers)) {
ranges::rotate(begin(_wallpapers), legacy3, legacy3 + 1);
}
if (ranges::none_of(_wallpapers, Data::IsDefaultWallPaper)) {
_wallpapers.push_back(Data::DefaultWallPaper());
_wallpapers.back().setLocalImageAsThumbnail(std::make_shared<Image>(
u":/gui/art/background.jpg"_q));
u":/gui/art/bg_thumbnail.png"_q));
}
}