2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Add reaction animations to comments.

This commit is contained in:
John Preston
2022-01-11 18:33:14 +03:00
parent 34c36d77c3
commit 490e688a91
8 changed files with 101 additions and 56 deletions

View File

@@ -86,6 +86,24 @@ void Reactions::preloadImageFor(const QString &emoji) {
}
}
void Reactions::preloadAnimationsFor(const QString &emoji) {
const auto i = ranges::find(_available, emoji, &Reaction::emoji);
if (i == end(_available)) {
return;
}
const auto preload = [&](DocumentData *document) {
const auto view = document
? document->activeMediaView()
: nullptr;
if (view) {
view->checkStickerLarge();
}
};
preload(i->centerIcon);
preload(i->aroundAnimation);
}
QImage Reactions::resolveImageFor(
const QString &emoji,
ImageSize size) {