diff --git a/Telegram/Resources/icons/poll/uploading.tgs b/Telegram/Resources/icons/poll/uploading.tgs new file mode 100644 index 0000000000..77973c5563 Binary files /dev/null and b/Telegram/Resources/icons/poll/uploading.tgs differ diff --git a/Telegram/Resources/qrc/telegram/animations.qrc b/Telegram/Resources/qrc/telegram/animations.qrc index 573e1917d3..be013f2e59 100644 --- a/Telegram/Resources/qrc/telegram/animations.qrc +++ b/Telegram/Resources/qrc/telegram/animations.qrc @@ -60,6 +60,7 @@ ../../animations/craft_failed.tgs ../../animations/stop.tgs ../../icons/poll/toast_hide_results.tgs + ../../icons/poll/uploading.tgs ../../animations/profile/profile_muting.tgs ../../animations/profile/profile_unmuting.tgs diff --git a/Telegram/SourceFiles/boxes/create_poll_box.cpp b/Telegram/SourceFiles/boxes/create_poll_box.cpp index 6ca576e608..80c27839f8 100644 --- a/Telegram/SourceFiles/boxes/create_poll_box.cpp +++ b/Telegram/SourceFiles/boxes/create_poll_box.cpp @@ -1173,6 +1173,16 @@ void DurationIconAction::paintEvent(QPaintEvent *e) { Ui::PaintTimerIcon(p, innerRect, _tinyText, st::menuIconColor->c); } +void ShowMediaUploadingToast() { + Ui::Toast::Show({ + .title = tr::lng_polls_media_uploading_toast_title(tr::now), + .text = tr::lng_polls_media_uploading_toast(tr::now, tr::marked), + .iconLottie = u"uploading"_q, + .iconLottieSize = st::pollToastUploadingIconSize, + .duration = crl::time(3000), + }); +} + } // namespace CreatePollBox::CreatePollBox( @@ -1208,7 +1218,7 @@ void CreatePollBox::submitFailed(const QString &error) { void CreatePollBox::submitMediaExpired() { if (_refreshExpiredMedia) { _refreshExpiredMedia(); - showToast(tr::lng_polls_media_uploading_toast(tr::now)); + ShowMediaUploadingToast(); } } @@ -2958,7 +2968,7 @@ object_ptr CreatePollBox::setupContent() { if (refreshedAny) { collectError(); if (state->error & Error::Media) { - showError(tr::lng_polls_media_uploading_toast); + ShowMediaUploadingToast(); } return; } @@ -2975,7 +2985,7 @@ object_ptr CreatePollBox::setupContent() { } else if (state->error & Error::Solution) { solution->showError(); } else if (state->error & Error::Media) { - showError(tr::lng_polls_media_uploading_toast); + ShowMediaUploadingToast(); } else if (state->error & Error::Deadline) { showError(tr::lng_polls_create_deadline_expired); } else if (!state->error) { diff --git a/Telegram/SourceFiles/boxes/polls.style b/Telegram/SourceFiles/boxes/polls.style index ad9b869c67..6651146713 100644 --- a/Telegram/SourceFiles/boxes/polls.style +++ b/Telegram/SourceFiles/boxes/polls.style @@ -273,4 +273,5 @@ pollMediaField: InputField(createPollSolutionField) { infoPollsNewButtonBottom: 19px; +pollToastUploadingIconSize: size(30px, 30px); pollToastIconSize: size(22px, 22px);