From 1d04cae3c2e886367f4677d034904f93a15030d6 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sat, 11 Apr 2026 12:28:32 +0300 Subject: [PATCH] Replaced chart emoji with themed poll icon in reply view. --- Telegram/SourceFiles/boxes/polls.style | 2 ++ .../SourceFiles/history/view/history_view_reply.cpp | 13 +++++++++++++ .../SourceFiles/history/view/history_view_reply.h | 1 + 3 files changed, 16 insertions(+) diff --git a/Telegram/SourceFiles/boxes/polls.style b/Telegram/SourceFiles/boxes/polls.style index 6651146713..bcdafbe095 100644 --- a/Telegram/SourceFiles/boxes/polls.style +++ b/Telegram/SourceFiles/boxes/polls.style @@ -48,6 +48,8 @@ historyPollRadio: Radio(defaultRadio) { rippleAreaPadding: 8px; } historyPollCheckboxRadius: 3px; +historyPollReplyIcon: icon {{ "dialogs/dialogs_chatlist_poll-17x17", windowFg }}; +historyPollReplyIconSkip: 3px; historyPollRadioOpacity: 0.7; historyPollRadioOpacityOver: 1.; historyPollDuration: 300; diff --git a/Telegram/SourceFiles/history/view/history_view_reply.cpp b/Telegram/SourceFiles/history/view/history_view_reply.cpp index 859b6147ba..02d79e12a3 100644 --- a/Telegram/SourceFiles/history/view/history_view_reply.cpp +++ b/Telegram/SourceFiles/history/view/history_view_reply.cpp @@ -391,6 +391,7 @@ void Reply::update( _displaying = data->displaying() ? 1 : 0; _multiline = data->multiline() ? 1 : 0; _replyToStory = (fields.storyId != 0); + _replyToPoll = (messagePoll && !pollAnswer) ? 1 : 0; const auto hasQuoteIcon = _displaying && fields.manualQuote && !fields.quote.empty(); @@ -418,6 +419,8 @@ void Reply::update( .image = MakePollAnswerImage(), .margin = QMargins(0, st::lineWidth, st::lineWidth, 0), })).append(pollAnswer->text) + : messagePoll + ? TextWithEntities().append(messagePoll->question) : (message && (fields.quote.empty() || !fields.manualQuote)) ? message->inReplyText() : !fields.quote.empty() @@ -1023,6 +1026,16 @@ void Reply::paint( firstLineSkip += st::dialogsMiniReplyStory.skipText + st::dialogsMiniReplyStory.icon.icon.width(); } + if (_replyToPoll) { + st::historyPollReplyIcon.paint( + p, + textLeft + firstLineSkip, + textTop, + w + 2 * x, + replyToTextPalette->linkFg->c); + firstLineSkip += st::historyPollReplyIconSkip + + st::historyPollReplyIcon.width(); + } _text.draw(p, { .position = { textLeft, textTop }, .geometry = textGeometry(textw, firstLineSkip), diff --git a/Telegram/SourceFiles/history/view/history_view_reply.h b/Telegram/SourceFiles/history/view/history_view_reply.h index 7cd8cd35a8..d622125267 100644 --- a/Telegram/SourceFiles/history/view/history_view_reply.h +++ b/Telegram/SourceFiles/history/view/history_view_reply.h @@ -153,6 +153,7 @@ private: uint8 _hiddenSenderColorIndexPlusOne : 7 = 0; uint8 _hasQuoteIcon : 1 = 0; uint8 _replyToStory : 1 = 0; + uint8 _replyToPoll : 1 = 0; uint8 _expanded : 1 = 0; mutable uint8 _expandable : 1 = 0; mutable uint8 _minHeightExpandable : 1 = 0;