mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-18 15:17:07 +02:00
Provided parent for toast to CopyInviteLink.
This commit is contained in:
parent
71ee2de354
commit
d9cdff3e6e
3 changed files with 6 additions and 6 deletions
Telegram/SourceFiles/boxes/peers
|
@ -342,7 +342,7 @@ void Controller::addHeaderBlock(not_null<Ui::VerticalLayout*> container) {
|
|||
const auto admin = current.admin;
|
||||
const auto weak = Ui::MakeWeak(container);
|
||||
const auto copyLink = crl::guard(weak, [=] {
|
||||
CopyInviteLink(link);
|
||||
CopyInviteLink(delegate()->peerListToastParent(), link);
|
||||
});
|
||||
const auto shareLink = crl::guard(weak, [=] {
|
||||
ShareInviteLinkBox(_peer, link);
|
||||
|
@ -949,7 +949,7 @@ void AddPermanentLinkBlock(
|
|||
const auto weak = Ui::MakeWeak(container);
|
||||
const auto copyLink = crl::guard(weak, [=] {
|
||||
if (const auto current = value->current(); !current.link.isEmpty()) {
|
||||
CopyInviteLink(current.link);
|
||||
CopyInviteLink(show->toastParent(), current.link);
|
||||
}
|
||||
});
|
||||
const auto shareLink = crl::guard(weak, [=] {
|
||||
|
@ -1111,9 +1111,9 @@ void AddPermanentLinkBlock(
|
|||
}));
|
||||
}
|
||||
|
||||
void CopyInviteLink(const QString &link) {
|
||||
void CopyInviteLink(not_null<QWidget*> toastParent, const QString &link) {
|
||||
QGuiApplication::clipboard()->setText(link);
|
||||
Ui::Toast::Show(tr::lng_group_invite_copied(tr::now));
|
||||
Ui::Toast::Show(toastParent, tr::lng_group_invite_copied(tr::now));
|
||||
}
|
||||
|
||||
void ShareInviteLinkBox(not_null<PeerData*> peer, const QString &link) {
|
||||
|
|
|
@ -34,7 +34,7 @@ void AddPermanentLinkBlock(
|
|||
not_null<UserData*> admin,
|
||||
rpl::producer<Api::InviteLink> fromList);
|
||||
|
||||
void CopyInviteLink(const QString &link);
|
||||
void CopyInviteLink(not_null<QWidget*> toastParent, const QString &link);
|
||||
void ShareInviteLinkBox(not_null<PeerData*> peer, const QString &link);
|
||||
[[nodiscard]] object_ptr<Ui::BoxContent> InviteLinkQrBox(const QString &link);
|
||||
[[nodiscard]] object_ptr<Ui::BoxContent> RevokeLinkBox(
|
||||
|
|
|
@ -585,7 +585,7 @@ base::unique_qptr<Ui::PopupMenu> LinksController::createRowContextMenu(
|
|||
}, &st::menuIconDelete);
|
||||
} else {
|
||||
result->addAction(tr::lng_group_invite_context_copy(tr::now), [=] {
|
||||
CopyInviteLink(link);
|
||||
CopyInviteLink(delegate()->peerListToastParent(), link);
|
||||
}, &st::menuIconCopy);
|
||||
result->addAction(tr::lng_group_invite_context_share(tr::now), [=] {
|
||||
ShareInviteLinkBox(_peer, link);
|
||||
|
|
Loading…
Add table
Reference in a new issue