From d556d3f5752d1ada6e10a0c3155134d8a7b2bb73 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 23 Jan 2026 18:19:21 +0400 Subject: [PATCH] Fix icon coloring in new bot topics. --- .../history/view/history_view_service_message.cpp | 3 ++- Telegram/SourceFiles/info/profile/info_profile_cover.cpp | 6 ++++-- Telegram/SourceFiles/info/profile/info_profile_cover.h | 5 ++++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_service_message.cpp b/Telegram/SourceFiles/history/view/history_view_service_message.cpp index 677bae1c05..c629384294 100644 --- a/Telegram/SourceFiles/history/view/history_view_service_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_service_message.cpp @@ -969,7 +969,8 @@ void EmptyPainter::paint( if (_icon) { _icon->paintInRect( p, - QRect(bubbleLeft, top, bubbleWidth, iconHeight)); + QRect(bubbleLeft, top, bubbleWidth, iconHeight), + st->msgServiceFg()->c); top += iconHeight + st::historyGroupAboutHeaderSkip; } diff --git a/Telegram/SourceFiles/info/profile/info_profile_cover.cpp b/Telegram/SourceFiles/info/profile/info_profile_cover.cpp index 19b8e5f066..49cb8f727a 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_cover.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_cover.cpp @@ -113,7 +113,7 @@ TopicIconView::TopicIconView( setup(topic); } -void TopicIconView::paintInRect(QPainter &p, QRect rect) { +void TopicIconView::paintInRect(QPainter &p, QRect rect, QColor textColor) { const auto paint = [&](const QImage &image) { const auto size = image.size() / style::DevicePixelRatio(); p.drawImage( @@ -125,7 +125,9 @@ void TopicIconView::paintInRect(QPainter &p, QRect rect) { image); }; if (_player && _player->ready()) { - const auto colored = _playerUsesTextColor + const auto colored = (textColor.alpha() > 0) + ? textColor + : _playerUsesTextColor ? st::windowFg->c : QColor(0, 0, 0, 0); paint(_player->frame( diff --git a/Telegram/SourceFiles/info/profile/info_profile_cover.h b/Telegram/SourceFiles/info/profile/info_profile_cover.h index fc7e72e403..f83f4ea4cb 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_cover.h +++ b/Telegram/SourceFiles/info/profile/info_profile_cover.h @@ -63,7 +63,10 @@ public: Fn update, const style::color &generalIconFg); - void paintInRect(QPainter &p, QRect rect); + void paintInRect( + QPainter &p, + QRect rect, + QColor textColor = QColor(0, 0, 0, 0)); private: using StickerPlayer = HistoryView::StickerPlayer;