Fix multiple answers polls voting.

This commit is contained in:
John Preston 2020-01-14 17:50:14 +03:00
parent 3e0b2f5553
commit c3aa2abe11
4 changed files with 16 additions and 6 deletions

View File

@ -2196,7 +2196,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_polls_create_settings" = "Settings";
"lng_polls_create_hint" = "Tap to select the right option";
"lng_polls_create_anonymous" = "Anonymous Votes";
"lng_polls_create_multiple_choice" = "Multiple Choice";
"lng_polls_create_multiple_choice" = "Multiple Answers";
"lng_polls_create_quiz_mode" = "Quiz Mode";
"lng_polls_create_button" = "Create";

View File

@ -937,3 +937,16 @@ pollResultsVotesCount: FlatLabel(defaultFlatLabel) {
textFg: windowSubTextFg;
}
pollResultsHeaderPadding: margins(22px, 8px, 22px, 8px);
pollResultsShowMore: SettingsButton {
textFg: lightButtonFg;
textFgOver: lightButtonFgOver;
textBg: windowBg;
textBgOver: windowBgOver;
font: semiboldFont;
height: 20px;
padding: margins(71px, 10px, 8px, 8px);
ripple: defaultRippleAnimation;
}

View File

@ -277,7 +277,7 @@ void CreateAnswerRows(
lt_count_decimal,
rpl::single(answer.votes + 0.),
Ui::Text::Upper),
st::infoMainButton)),
st::pollResultsShowMore)),
style::margins());
more->toggle(answer.votes > kFirstPage, anim::type::instant);
more->entity()->setClickedCallback([=] {

View File

@ -256,11 +256,8 @@ bool Poll::canSendVotes() const {
}
bool Poll::showVotersCount() const {
if (!_totalVotes) {
return true;
}
return showVotes()
? !(_flags & PollData::Flag::PublicVotes)
? (!_totalVotes || !(_flags & PollData::Flag::PublicVotes))
: !(_flags & PollData::Flag::MultiChoice);
}