mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Added ability to share QR code of bots.
This commit is contained in:
parent
fbaa79f168
commit
7cc9a0b9aa
1 changed files with 3 additions and 14 deletions
|
@ -1121,22 +1121,11 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
|
|||
if (user) {
|
||||
const auto copyUsername = Ui::CreateChild<Ui::IconButton>(
|
||||
usernameLine.text->parentWidget(),
|
||||
user->isBot()
|
||||
? st::infoProfileLabeledButtonCopy
|
||||
: st::infoProfileLabeledButtonQr);
|
||||
st::infoProfileLabeledButtonQr);
|
||||
fitLabelToButton(copyUsername, usernameLine.text);
|
||||
copyUsername->setClickedCallback([=] {
|
||||
if (!user->isBot()) {
|
||||
controller->show(
|
||||
Box(Ui::FillPeerQrBox, user, std::nullopt, nullptr));
|
||||
return false;
|
||||
}
|
||||
const auto link = user->session().createInternalLinkFull(
|
||||
user->username());
|
||||
if (!link.isEmpty()) {
|
||||
QGuiApplication::clipboard()->setText(link);
|
||||
controller->showToast(tr::lng_username_copied(tr::now));
|
||||
}
|
||||
controller->show(
|
||||
Box(Ui::FillPeerQrBox, user, std::nullopt, nullptr));
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue