mirror of
https://github.com/vale981/tdesktop
synced 2025-03-05 09:41:41 -05:00
Move transfer ownership button.
This commit is contained in:
parent
3715fa4b1e
commit
569340c7d3
1 changed files with 14 additions and 17 deletions
|
@ -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<Ui::FlatLabel>(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<Ui::SlideWrap<Ui::RpWidget>*> EditAdminBox::setupTransferButton(
|
|||
object_ptr<Ui::VerticalLayout>(this)));
|
||||
|
||||
const auto container = wrap->entity();
|
||||
const auto addDivider = [&] {
|
||||
container->add(
|
||||
object_ptr<BoxContentDivider>(container),
|
||||
{ 0, st::infoProfileSkip, 0, st::infoProfileSkip });
|
||||
};
|
||||
|
||||
addDivider();
|
||||
container->add(
|
||||
object_ptr<BoxContentDivider>(container),
|
||||
{ 0, st::infoProfileSkip, 0, st::infoProfileSkip });
|
||||
container->add(EditPeerInfoBox::CreateButton(
|
||||
this,
|
||||
(isGroup
|
||||
|
@ -485,7 +483,6 @@ not_null<Ui::SlideWrap<Ui::RpWidget>*> EditAdminBox::setupTransferButton(
|
|||
rpl::single(QString()),
|
||||
[=] { transferOwnership(); },
|
||||
st::peerPermissionsButton));
|
||||
addDivider();
|
||||
|
||||
return wrap;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue