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

Change default wallpaper.

This commit is contained in:
John Preston
2021-07-23 12:16:33 +03:00
parent 9943f8a093
commit 8f478b86ee
10 changed files with 34 additions and 14 deletions

View File

@@ -4155,10 +4155,19 @@ void Session::setWallpapers(const QVector<MTPWallPaper> &data, int32 hash) {
_wallpapers.push_back(*parsed);
}
}
// Put the legacy2 (flowers) wallpaper to the front of the list.
const auto legacy2 = ranges::find_if(
_wallpapers,
Data::IsLegacy2DefaultWallPaper);
if (legacy2 != end(_wallpapers)) {
ranges::rotate(begin(_wallpapers), legacy2, legacy2 + 1);
}
if (ranges::none_of(_wallpapers, Data::IsDefaultWallPaper)) {
_wallpapers.push_back(Data::DefaultWallPaper());
_wallpapers.back().setLocalImageAsThumbnail(std::make_shared<Image>(
u":/gui/arg/bg.jpg"_q));
u":/gui/art/background.jpg"_q));
}
}