From 569340c7d3a369420fac261818c5f6624c452dbe Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 30 Aug 2019 17:06:37 +0300 Subject: [PATCH] Move transfer ownership button. --- .../boxes/peers/edit_participant_box.cpp | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp index 7184fb3104..2b4a2353fd 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_participant_box.cpp @@ -354,16 +354,6 @@ void EditAdminBox::prepare() { ) | rpl::then(std::move( changes )); - if (canTransferOwnership()) { - const auto allFlags = FullAdminRights(isGroup); - setupTransferButton( - isGroup - )->toggleOn(rpl::duplicate( - selectedFlags - ) | rpl::map( - ((_1 & allFlags) == allFlags) - ))->setDuration(0); - } _aboutAddAdmins = addControl( object_ptr(this, st::boxDividerLabel), st::rightsAboutMargin); @@ -376,6 +366,17 @@ void EditAdminBox::prepare() { refreshAboutAddAdminsText(checked); }, lifetime()); + if (canTransferOwnership()) { + const auto allFlags = FullAdminRights(isGroup); + setupTransferButton( + isGroup + )->toggleOn(rpl::duplicate( + selectedFlags + ) | rpl::map( + ((_1 & allFlags) == allFlags) + ))->setDuration(0); + } + if (canSave()) { const auto rank = (chat || channel->isMegagroup()) ? addRankInput().get() @@ -470,13 +471,10 @@ not_null*> EditAdminBox::setupTransferButton( object_ptr(this))); const auto container = wrap->entity(); - const auto addDivider = [&] { - container->add( - object_ptr(container), - { 0, st::infoProfileSkip, 0, st::infoProfileSkip }); - }; - addDivider(); + container->add( + object_ptr(container), + { 0, st::infoProfileSkip, 0, st::infoProfileSkip }); container->add(EditPeerInfoBox::CreateButton( this, (isGroup @@ -485,7 +483,6 @@ not_null*> EditAdminBox::setupTransferButton( rpl::single(QString()), [=] { transferOwnership(); }, st::peerPermissionsButton)); - addDivider(); return wrap; }