mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 22:16:14 +00:00
Change default wallpaper.
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user