2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Show nice star in stars payments.

This commit is contained in:
John Preston
2024-07-23 07:51:04 +02:00
parent 0bfb0fd045
commit 54ce85f8e6
4 changed files with 41 additions and 13 deletions

View File

@@ -17,6 +17,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "history/history_item_helpers.h"
#include "history/history_translation.h"
#include "history/history_unread_things.h"
#include "core/ui_integration.h"
#include "dialogs/ui/dialogs_layout.h"
#include "data/business/data_shortcut_messages.h"
#include "data/components/scheduled_messages.h"
@@ -1128,14 +1129,23 @@ void History::applyServiceChanges(
}
if (paid) {
// Toast on a current active window.
const auto context = [=](not_null<QWidget*> toast) {
return Core::MarkedTextContext{
.session = &session(),
.customEmojiRepaint = [=] { toast->update(); },
};
};
Ui::Toast::Show({
.text = tr::lng_payments_success(
tr::now,
lt_amount,
Ui::Text::Bold(payment->amount),
Ui::Text::Wrapped(
payment->amount,
EntityType::Bold),
lt_title,
Ui::Text::Bold(paid->title),
Ui::Text::WithEntities),
.textContext = context,
});
}
}