2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-01 15:15:13 +00:00

Move 'Add to contacts' button up in Info.

This commit is contained in:
John Preston
2019-07-04 12:07:32 +02:00
parent dd38da7737
commit 729da4a6b4
4 changed files with 47 additions and 24 deletions

View File

@@ -259,7 +259,7 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
addInfoOneLine(
tr::lng_info_mobile_label(),
PhoneValue(user),
PhoneOrHiddenValue(user),
tr::lng_profile_copy_phone(tr::now));
if (user->botInfo) {
addInfoLine(tr::lng_info_about_label(), AboutValue(user));
@@ -270,6 +270,14 @@ object_ptr<Ui::RpWidget> DetailsFiller::setupInfo() {
tr::lng_info_username_label(),
UsernameValue(user),
tr::lng_context_copy_mention(tr::now));
const auto window = &_controller->parentController()->window()->controller();
AddMainButton(
result,
tr::lng_info_add_as_contact(),
CanAddContactValue(user),
[=] { window->show(Box(EditContactBox, window, user)); },
tracker);
} else {
auto linkText = LinkValue(
_peer
@@ -419,14 +427,6 @@ Ui::MultiSlideTracker DetailsFiller::fillUserButtons(
);
} else {
addSendMessageButton();
const auto window = &_controller->parentController()->window()->controller();
AddMainButton(
_wrap,
tr::lng_info_add_as_contact(),
CanAddContactValue(user),
[=] { window->show(Box(EditContactBox, window, user)); },
tracker);
}
return tracker;
}