2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 08:55:59 +00:00

Fixed display of most of simple toasts in corresponding window.

This commit is contained in:
23rd
2022-06-14 12:48:25 +03:00
parent 29910cd1f7
commit 629574685e
27 changed files with 179 additions and 79 deletions

View File

@@ -324,9 +324,10 @@ void EditCaptionBox::setupControls() {
}
void EditCaptionBox::setupEditEventHandler() {
const auto toastParent = Ui::BoxShow(this).toastParent();
const auto callback = [=](FileDialog::OpenResult &&result) {
auto showError = [](tr::phrase<> t) {
Ui::Toast::Show(t(tr::now));
auto showError = [toastParent](tr::phrase<> t) {
Ui::Toast::Show(toastParent, t(tr::now));
};
const auto checkResult = [=](const Ui::PreparedList &list) {
@@ -547,7 +548,9 @@ bool EditCaptionBox::setPreparedList(Ui::PreparedList &&list) {
}
}
if (invalidForAlbum) {
Ui::Toast::Show(tr::lng_edit_media_album_error(tr::now));
Ui::Toast::Show(
Ui::BoxShow(this).toastParent(),
tr::lng_edit_media_album_error(tr::now));
return false;
}
_preparedList = std::move(list);