2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Remove CenterWrap layout.

This commit is contained in:
John Preston
2025-08-18 17:23:54 +04:00
parent a39c018359
commit 313ae0f86c
63 changed files with 456 additions and 535 deletions

View File

@@ -142,13 +142,12 @@ void ConfirmSubscriptionBox(
const auto content = box->verticalLayout();
Ui::AddSkip(content, st::confirmInvitePhotoTop);
const auto userpicWrap = content->add(
object_ptr<Ui::CenterWrap<>>(
content,
object_ptr<Ui::RpWidget>(content)));
const auto userpic = userpicWrap->entity();
const auto userpic = content->add(
object_ptr<Ui::RpWidget>(content),
style::al_top);
const auto photoSize = st::confirmInvitePhotoSize;
userpic->resize(Size(photoSize));
userpic->setNaturalWidth(photoSize);
const auto creditsIconSize = photoSize / 3;
const auto creditsIconCallback =
Ui::PaintOutlinedColoredCreditsIconCallback(
@@ -188,8 +187,8 @@ void ConfirmSubscriptionBox(
}
auto p = QPainter(userpic);
p.drawImage(0, 0, state->frame);
}, userpicWrap->lifetime());
userpicWrap->setAttribute(Qt::WA_TransparentForMouseEvents);
}, userpic->lifetime());
userpic->setAttribute(Qt::WA_TransparentForMouseEvents);
if (photo) {
state->photoMedia = photo->createMediaView();
state->photoMedia->wanted(Data::PhotoSize::Small, Data::FileOrigin());
@@ -197,7 +196,7 @@ void ConfirmSubscriptionBox(
session->downloaderTaskFinished(
) | rpl::start_with_next([=] {
userpic->update();
}, userpicWrap->entity()->lifetime());
}, userpic->lifetime());
}
} else {
state->photoEmpty = std::make_unique<Ui::EmptyUserpic>(
@@ -219,7 +218,6 @@ void ConfirmSubscriptionBox(
box,
tr::lng_channel_invite_subscription_title(),
st::inviteLinkSubscribeBoxTitle),
st::boxRowPadding,
style::al_top);
box->addRow(
object_ptr<Ui::FlatLabel>(
@@ -234,7 +232,6 @@ void ConfirmSubscriptionBox(
Ui::Text::Bold),
Ui::Text::WithEntities),
st::inviteLinkSubscribeBoxAbout),
st::boxRowPadding,
style::al_top);
Ui::AddSkip(content);
box->addRow(
@@ -250,7 +247,6 @@ void ConfirmSubscriptionBox(
}),
Ui::Text::RichLangValue),
st::inviteLinkSubscribeBoxTerms),
st::boxRowPadding,
style::al_top);
{