mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-30 22:16:14 +00:00
Added ability to copy phone number from main menu.
This commit is contained in:
@@ -223,7 +223,7 @@ void ShowMenu(
|
||||
QWidget *parent,
|
||||
const QString ©Button,
|
||||
const QString &text) {
|
||||
const auto menu = new Ui::PopupMenu(parent);
|
||||
const auto menu = Ui::CreateChild<Ui::PopupMenu>(parent);
|
||||
|
||||
menu->addAction(copyButton, [=] {
|
||||
QGuiApplication::clipboard()->setText(text);
|
||||
@@ -568,6 +568,12 @@ void SetupAccountsWrap(
|
||||
state->menu = base::make_unique_q<Ui::PopupMenu>(
|
||||
raw,
|
||||
st::popupMenuWithIcons);
|
||||
addAction(tr::lng_profile_copy_phone(tr::now), [=] {
|
||||
const auto phone = rpl::variable<TextWithEntities>(
|
||||
Info::Profile::PhoneValue(session->user()));
|
||||
QGuiApplication::clipboard()->setText(phone.current().text);
|
||||
}, &st::menuIconCopy);
|
||||
|
||||
addAction(tr::lng_menu_activate(tr::now), [=] {
|
||||
Core::App().domain().activate(&session->account());
|
||||
}, &st::menuIconProfile);
|
||||
|
Reference in New Issue
Block a user