From db9e60b4b50641dad42338a5e972c559b7465a05 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sun, 26 Jan 2025 08:48:53 +0300 Subject: [PATCH] Added amount of total voters to poll results with multiple answers. Fixed #28879. --- .../polls/info_polls_results_inner_widget.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/info/polls/info_polls_results_inner_widget.cpp b/Telegram/SourceFiles/info/polls/info_polls_results_inner_widget.cpp index d2b8b31b93fc50..18fdcce09fb75d 100644 --- a/Telegram/SourceFiles/info/polls/info_polls_results_inner_widget.cpp +++ b/Telegram/SourceFiles/info/polls/info_polls_results_inner_widget.cpp @@ -17,6 +17,7 @@ For license and copyright information please follow this link: #include "ui/wrap/vertical_layout.h" #include "ui/wrap/slide_wrap.h" #include "ui/text/text_utilities.h" +#include "ui/vertical_list.h" #include "boxes/peer_list_box.h" #include "main/main_session.h" #include "history/history.h" @@ -610,11 +611,17 @@ void InnerWidget::setupContent() { _content, rpl::single(_poll->question), st::pollResultsQuestion), - style::margins{ - st::boxRowPadding.left(), - 0, - st::boxRowPadding.right(), - st::boxMediumSkip }); + st::boxRowPadding); + Ui::AddSkip(_content, st::boxLittleSkip / 2); + _content->add( + object_ptr( + _content, + tr::lng_polls_votes_count( + lt_count_decimal, + rpl::single(float64(_poll->totalVoters))), + st::boxDividerLabel), + st::boxRowPadding); + Ui::AddSkip(_content, st::boxLittleSkip); for (const auto &answer : _poll->answers) { const auto session = &_controller->session(); const auto controller = CreateAnswerRows(