Fix icon coloring in new bot topics.

This commit is contained in:
John Preston
2026-01-23 18:19:21 +04:00
parent de3862950e
commit d556d3f575
3 changed files with 10 additions and 4 deletions
@@ -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;
}
@@ -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(
@@ -63,7 +63,10 @@ public:
Fn<void()> 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;