From d0a8bd1f03afe802609d38e7e828c27eb3d8e947 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 13 Sep 2024 20:03:32 +0400 Subject: [PATCH] Use colored topic icons only when required. --- Telegram/SourceFiles/info/profile/info_profile_cover.cpp | 6 +++++- Telegram/SourceFiles/info/profile/info_profile_cover.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Telegram/SourceFiles/info/profile/info_profile_cover.cpp b/Telegram/SourceFiles/info/profile/info_profile_cover.cpp index fc44bc946..3c6fc0e7f 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_cover.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_cover.cpp @@ -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 topic) { st::infoTopicCover.photo.size); } result->setRepaintCallback(_update); + _playerUsesTextColor = media->owner()->emojiUsesTextColor(); return result; }); }) | rpl::flatten_latest( diff --git a/Telegram/SourceFiles/info/profile/info_profile_cover.h b/Telegram/SourceFiles/info/profile/info_profile_cover.h index dec3e44ac..c4f5a73ae 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_cover.h +++ b/Telegram/SourceFiles/info/profile/info_profile_cover.h @@ -71,6 +71,7 @@ private: Fn _paused; Fn _update; std::shared_ptr _player; + bool _playerUsesTextColor = false; QImage _image; rpl::lifetime _lifetime;