Replaced chart emoji with themed poll icon in reply view.

This commit is contained in:
23rd
2026-04-11 12:28:32 +03:00
parent 57c5ddc774
commit 1d04cae3c2
3 changed files with 16 additions and 0 deletions
+2
View File
@@ -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;
@@ -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),
@@ -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;