mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
[poll-create] Added lottie icon to toast.
This commit is contained in:
Binary file not shown.
@@ -60,6 +60,7 @@
|
|||||||
<file alias="craft_failed.tgs">../../animations/craft_failed.tgs</file>
|
<file alias="craft_failed.tgs">../../animations/craft_failed.tgs</file>
|
||||||
<file alias="stop.tgs">../../animations/stop.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="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_muting.tgs">../../animations/profile/profile_muting.tgs</file>
|
||||||
<file alias="profile_unmuting.tgs">../../animations/profile/profile_unmuting.tgs</file>
|
<file alias="profile_unmuting.tgs">../../animations/profile/profile_unmuting.tgs</file>
|
||||||
|
|||||||
@@ -1173,6 +1173,16 @@ void DurationIconAction::paintEvent(QPaintEvent *e) {
|
|||||||
Ui::PaintTimerIcon(p, innerRect, _tinyText, st::menuIconColor->c);
|
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
|
} // namespace
|
||||||
|
|
||||||
CreatePollBox::CreatePollBox(
|
CreatePollBox::CreatePollBox(
|
||||||
@@ -1208,7 +1218,7 @@ void CreatePollBox::submitFailed(const QString &error) {
|
|||||||
void CreatePollBox::submitMediaExpired() {
|
void CreatePollBox::submitMediaExpired() {
|
||||||
if (_refreshExpiredMedia) {
|
if (_refreshExpiredMedia) {
|
||||||
_refreshExpiredMedia();
|
_refreshExpiredMedia();
|
||||||
showToast(tr::lng_polls_media_uploading_toast(tr::now));
|
ShowMediaUploadingToast();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2958,7 +2968,7 @@ object_ptr<Ui::RpWidget> CreatePollBox::setupContent() {
|
|||||||
if (refreshedAny) {
|
if (refreshedAny) {
|
||||||
collectError();
|
collectError();
|
||||||
if (state->error & Error::Media) {
|
if (state->error & Error::Media) {
|
||||||
showError(tr::lng_polls_media_uploading_toast);
|
ShowMediaUploadingToast();
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -2975,7 +2985,7 @@ object_ptr<Ui::RpWidget> CreatePollBox::setupContent() {
|
|||||||
} else if (state->error & Error::Solution) {
|
} else if (state->error & Error::Solution) {
|
||||||
solution->showError();
|
solution->showError();
|
||||||
} else if (state->error & Error::Media) {
|
} else if (state->error & Error::Media) {
|
||||||
showError(tr::lng_polls_media_uploading_toast);
|
ShowMediaUploadingToast();
|
||||||
} else if (state->error & Error::Deadline) {
|
} else if (state->error & Error::Deadline) {
|
||||||
showError(tr::lng_polls_create_deadline_expired);
|
showError(tr::lng_polls_create_deadline_expired);
|
||||||
} else if (!state->error) {
|
} else if (!state->error) {
|
||||||
|
|||||||
@@ -273,4 +273,5 @@ pollMediaField: InputField(createPollSolutionField) {
|
|||||||
|
|
||||||
infoPollsNewButtonBottom: 19px;
|
infoPollsNewButtonBottom: 19px;
|
||||||
|
|
||||||
|
pollToastUploadingIconSize: size(30px, 30px);
|
||||||
pollToastIconSize: size(22px, 22px);
|
pollToastIconSize: size(22px, 22px);
|
||||||
|
|||||||
Reference in New Issue
Block a user