mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Use colored topic icons only when required.
This commit is contained in:
parent
c9e0f50f0f
commit
d0a8bd1f03
2 changed files with 6 additions and 1 deletions
|
@ -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(
|
||||
|
|
|
@ -71,6 +71,7 @@ private:
|
|||
Fn<bool()> _paused;
|
||||
Fn<void()> _update;
|
||||
std::shared_ptr<StickerPlayer> _player;
|
||||
bool _playerUsesTextColor = false;
|
||||
QImage _image;
|
||||
rpl::lifetime _lifetime;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue