Skip to content

Commit

Permalink
Use colored topic icons only when required.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Sep 13, 2024
1 parent c9e0f50 commit d0a8bd1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Telegram/SourceFiles/info/profile/info_profile_cover.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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(
Expand Down
1 change: 1 addition & 0 deletions Telegram/SourceFiles/info/profile/info_profile_cover.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ class TopicIconView final {
Fn<bool()> _paused;
Fn<void()> _update;
std::shared_ptr<StickerPlayer> _player;
bool _playerUsesTextColor = false;
QImage _image;
rpl::lifetime _lifetime;

Expand Down

0 comments on commit d0a8bd1

Please sign in to comment.