feat: copy phone on click

This commit is contained in:
ZavaruKitsu 2024-01-28 22:55:38 +03:00
parent 58e38c487a
commit e47ff9fd34

View file

@ -369,17 +369,16 @@ void SetupRows(
[=] { controller->show(Box<EditNameBox>(self)); }, [=] { controller->show(Box<EditNameBox>(self)); },
{ &st::menuIconProfile }); { &st::menuIconProfile });
const auto showChangePhone = [=] { const auto copyPhone = [=] {
controller->show( QGuiApplication::clipboard()->setText(self->phone());
Ui::MakeInformBox(tr::lng_change_phone_error())); controller->showToast(tr::lng_text_copied(tr::now), 500);
controller->window().activate();
}; };
AddRow( AddRow(
container, container,
tr::lng_settings_phone_label(), tr::lng_settings_phone_label(),
Info::Profile::PhoneValue(self), Info::Profile::PhoneValue(self),
tr::lng_profile_copy_phone(tr::now), tr::lng_profile_copy_phone(tr::now),
showChangePhone, copyPhone,
{ &st::menuIconPhone }); { &st::menuIconPhone });
auto username = Info::Profile::UsernameValue(self); auto username = Info::Profile::UsernameValue(self);