[poll-create] Added lottie icon to toast.

This commit is contained in:
23rd
2026-03-28 22:45:22 +03:00
parent c0ae279031
commit 48027ae66b
4 changed files with 15 additions and 3 deletions
Binary file not shown.
@@ -60,6 +60,7 @@
<file alias="craft_failed.tgs">../../animations/craft_failed.tgs</file>
<file alias="stop.tgs">../../animations/stop.tgs</file>
<file alias="toast_hide_results.tgs">../../icons/poll/toast_hide_results.tgs</file>
<file alias="uploading.tgs">../../icons/poll/uploading.tgs</file>
<file alias="profile_muting.tgs">../../animations/profile/profile_muting.tgs</file>
<file alias="profile_unmuting.tgs">../../animations/profile/profile_unmuting.tgs</file>
+13 -3
View File
@@ -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<Ui::RpWidget> 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<Ui::RpWidget> 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) {
+1
View File
@@ -273,4 +273,5 @@ pollMediaField: InputField(createPollSolutionField) {
infoPollsNewButtonBottom: 19px;
pollToastUploadingIconSize: size(30px, 30px);
pollToastIconSize: size(22px, 22px);