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)); },
{ &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);