mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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);
|
image);
|
||||||
};
|
};
|
||||||
if (_player && _player->ready()) {
|
if (_player && _player->ready()) {
|
||||||
|
const auto colored = _playerUsesTextColor
|
||||||
|
? st::windowFg->c
|
||||||
|
: QColor(0, 0, 0, 0);
|
||||||
paint(_player->frame(
|
paint(_player->frame(
|
||||||
st::infoTopicCover.photo.size,
|
st::infoTopicCover.photo.size,
|
||||||
QColor(0, 0, 0, 0),
|
colored,
|
||||||
false,
|
false,
|
||||||
crl::now(),
|
crl::now(),
|
||||||
_paused()).image);
|
_paused()).image);
|
||||||
|
@ -196,6 +199,7 @@ void TopicIconView::setupPlayer(not_null<Data::ForumTopic*> topic) {
|
||||||
st::infoTopicCover.photo.size);
|
st::infoTopicCover.photo.size);
|
||||||
}
|
}
|
||||||
result->setRepaintCallback(_update);
|
result->setRepaintCallback(_update);
|
||||||
|
_playerUsesTextColor = media->owner()->emojiUsesTextColor();
|
||||||
return result;
|
return result;
|
||||||
});
|
});
|
||||||
}) | rpl::flatten_latest(
|
}) | rpl::flatten_latest(
|
||||||
|
|
|
@ -71,6 +71,7 @@ private:
|
||||||
Fn<bool()> _paused;
|
Fn<bool()> _paused;
|
||||||
Fn<void()> _update;
|
Fn<void()> _update;
|
||||||
std::shared_ptr<StickerPlayer> _player;
|
std::shared_ptr<StickerPlayer> _player;
|
||||||
|
bool _playerUsesTextColor = false;
|
||||||
QImage _image;
|
QImage _image;
|
||||||
rpl::lifetime _lifetime;
|
rpl::lifetime _lifetime;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue