From e47ff9fd34886cd0283392d757e32358e1b5cbc1 Mon Sep 17 00:00:00 2001 From: ZavaruKitsu Date: Sun, 28 Jan 2024 22:55:38 +0300 Subject: [PATCH] feat: copy phone on click --- Telegram/SourceFiles/settings/settings_information.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/settings/settings_information.cpp b/Telegram/SourceFiles/settings/settings_information.cpp index ef6068987..3fdb95d0e 100644 --- a/Telegram/SourceFiles/settings/settings_information.cpp +++ b/Telegram/SourceFiles/settings/settings_information.cpp @@ -369,17 +369,16 @@ void SetupRows( [=] { controller->show(Box(self)); }, { &st::menuIconProfile }); - const auto showChangePhone = [=] { - controller->show( - Ui::MakeInformBox(tr::lng_change_phone_error())); - controller->window().activate(); + const auto copyPhone = [=] { + QGuiApplication::clipboard()->setText(self->phone()); + controller->showToast(tr::lng_text_copied(tr::now), 500); }; AddRow( container, tr::lng_settings_phone_label(), Info::Profile::PhoneValue(self), tr::lng_profile_copy_phone(tr::now), - showChangePhone, + copyPhone, { &st::menuIconPhone }); auto username = Info::Profile::UsernameValue(self);