From d099e29fb93c9bfb8acc65fb5e7882ada8951dda Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sun, 29 Mar 2026 20:14:58 +0300 Subject: [PATCH] [poll-view] Fixed add-option overlap with last poll option filling bar. --- .../history/view/media/history_view_poll.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Telegram/SourceFiles/history/view/media/history_view_poll.cpp b/Telegram/SourceFiles/history/view/media/history_view_poll.cpp index 894e71248c..05c03f188c 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_poll.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_poll.cpp @@ -1521,11 +1521,16 @@ struct Poll::Options : public Poll::Part { }; int Poll::Options::countHeight(int innerWidth) const { - return ranges::accumulate(ranges::views::all( + auto result = ranges::accumulate(ranges::views::all( _answers ) | ranges::views::transform([&](const Answer &answer) { return countAnswerHeight(answer, innerWidth); }), 0); + if (_owner->canAddOption()) { + result += (st::historyPollChoiceRight.height() + - st::historyPollFillingHeight) / 2; + } + return result; } void Poll::Options::draw( @@ -1871,7 +1876,9 @@ QRect Poll::addOptionRect(int innerWidth) const { + st::historyPollSubtitleSkip + st::msgDateFont->height + st::historyPollAnswersSkip - + answersHeight; + + answersHeight + + (st::historyPollChoiceRight.height() + - st::historyPollFillingHeight) / 2; return QRect( st::msgPadding.left(), top,