mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Provided parent for toast to CopyInviteLink.
This commit is contained in:
@@ -342,7 +342,7 @@ void Controller::addHeaderBlock(not_null<Ui::VerticalLayout*> container) {
|
|||||||
const auto admin = current.admin;
|
const auto admin = current.admin;
|
||||||
const auto weak = Ui::MakeWeak(container);
|
const auto weak = Ui::MakeWeak(container);
|
||||||
const auto copyLink = crl::guard(weak, [=] {
|
const auto copyLink = crl::guard(weak, [=] {
|
||||||
CopyInviteLink(link);
|
CopyInviteLink(delegate()->peerListToastParent(), link);
|
||||||
});
|
});
|
||||||
const auto shareLink = crl::guard(weak, [=] {
|
const auto shareLink = crl::guard(weak, [=] {
|
||||||
ShareInviteLinkBox(_peer, link);
|
ShareInviteLinkBox(_peer, link);
|
||||||
@@ -949,7 +949,7 @@ void AddPermanentLinkBlock(
|
|||||||
const auto weak = Ui::MakeWeak(container);
|
const auto weak = Ui::MakeWeak(container);
|
||||||
const auto copyLink = crl::guard(weak, [=] {
|
const auto copyLink = crl::guard(weak, [=] {
|
||||||
if (const auto current = value->current(); !current.link.isEmpty()) {
|
if (const auto current = value->current(); !current.link.isEmpty()) {
|
||||||
CopyInviteLink(current.link);
|
CopyInviteLink(show->toastParent(), current.link);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const auto shareLink = crl::guard(weak, [=] {
|
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);
|
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) {
|
void ShareInviteLinkBox(not_null<PeerData*> peer, const QString &link) {
|
||||||
|
@@ -34,7 +34,7 @@ void AddPermanentLinkBlock(
|
|||||||
not_null<UserData*> admin,
|
not_null<UserData*> admin,
|
||||||
rpl::producer<Api::InviteLink> fromList);
|
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);
|
void ShareInviteLinkBox(not_null<PeerData*> peer, const QString &link);
|
||||||
[[nodiscard]] object_ptr<Ui::BoxContent> InviteLinkQrBox(const QString &link);
|
[[nodiscard]] object_ptr<Ui::BoxContent> InviteLinkQrBox(const QString &link);
|
||||||
[[nodiscard]] object_ptr<Ui::BoxContent> RevokeLinkBox(
|
[[nodiscard]] object_ptr<Ui::BoxContent> RevokeLinkBox(
|
||||||
|
@@ -585,7 +585,7 @@ base::unique_qptr<Ui::PopupMenu> LinksController::createRowContextMenu(
|
|||||||
}, &st::menuIconDelete);
|
}, &st::menuIconDelete);
|
||||||
} else {
|
} else {
|
||||||
result->addAction(tr::lng_group_invite_context_copy(tr::now), [=] {
|
result->addAction(tr::lng_group_invite_context_copy(tr::now), [=] {
|
||||||
CopyInviteLink(link);
|
CopyInviteLink(delegate()->peerListToastParent(), link);
|
||||||
}, &st::menuIconCopy);
|
}, &st::menuIconCopy);
|
||||||
result->addAction(tr::lng_group_invite_context_share(tr::now), [=] {
|
result->addAction(tr::lng_group_invite_context_share(tr::now), [=] {
|
||||||
ShareInviteLinkBox(_peer, link);
|
ShareInviteLinkBox(_peer, link);
|
||||||
|
Reference in New Issue
Block a user