Use colored topic icons only when required.

This commit is contained in:
John Preston 2024-09-13 20:03:32 +04:00
parent c9e0f50f0f
commit d0a8bd1f03
2 changed files with 6 additions and 1 deletions

View file

@ -131,9 +131,12 @@ void TopicIconView::paintInRect(QPainter &p, QRect rect) {
image);
};
if (_player && _player->ready()) {
const auto colored = _playerUsesTextColor
? st::windowFg->c
: QColor(0, 0, 0, 0);
paint(_player->frame(
st::infoTopicCover.photo.size,
QColor(0, 0, 0, 0),
colored,
false,
crl::now(),
_paused()).image);
@ -196,6 +199,7 @@ void TopicIconView::setupPlayer(not_null<Data::ForumTopic*> topic) {
st::infoTopicCover.photo.size);
}
result->setRepaintCallback(_update);
_playerUsesTextColor = media->owner()->emojiUsesTextColor();
return result;
});
}) | rpl::flatten_latest(

View file

@ -71,6 +71,7 @@ private:
Fn<bool()> _paused;
Fn<void()> _update;
std::shared_ptr<StickerPlayer> _player;
bool _playerUsesTextColor = false;
QImage _image;
rpl::lifetime _lifetime;