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

Added ability to create box for share QR code without peer.

This commit is contained in:
23rd
2024-09-10 13:37:19 +03:00
parent 0916836ff9
commit c47f5e9995
3 changed files with 35 additions and 27 deletions

View File

@@ -1127,9 +1127,8 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
fitLabelToButton(copyUsername, usernameLine.text);
copyUsername->setClickedCallback([=] {
if (!user->isBot()) {
controller->show(Box([=](not_null<Ui::GenericBox*> box) {
Ui::FillPeerQrBox(box, user);
}));
controller->show(
Box(Ui::FillPeerQrBox, user, std::nullopt, nullptr));
return false;
}
const auto link = user->session().createInternalLinkFull(
@@ -1209,9 +1208,8 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
st::infoProfileLabeledButtonQr);
fitLabelToButton(qr, linkLine.text);
qr->setClickedCallback([=, peer = _peer] {
controller->show(Box([=](not_null<Ui::GenericBox*> box) {
Ui::FillPeerQrBox(box, peer);
}));
controller->show(
Box(Ui::FillPeerQrBox, peer, std::nullopt, nullptr));
return false;
});
}