Fixed resizing of label in section of profile info.

This commit is contained in:
23rd 2024-08-05 19:00:16 +03:00 committed by John Preston
parent c985b77a48
commit c4f45c4b7c

View file

@ -29,11 +29,9 @@ TextWithLabel CreateTextWithLabel(
parent, parent,
object_ptr<Ui::VerticalLayout>(parent), object_ptr<Ui::VerticalLayout>(parent),
padding); padding);
result->setDuration( result->setDuration(st::infoSlideDuration);
st::infoSlideDuration
);
auto layout = result->entity(); auto layout = result->entity();
auto nonEmptyText = std::move( auto nonEmptyText = rpl::duplicate(
text text
) | rpl::before_next([slide = result.data()]( ) | rpl::before_next([slide = result.data()](
const TextWithEntities &value) { const TextWithEntities &value) {
@ -46,10 +44,13 @@ TextWithLabel CreateTextWithLabel(
const TextWithEntities &value) { const TextWithEntities &value) {
slide->show(anim::type::normal); slide->show(anim::type::normal);
}); });
auto labeled = layout->add(object_ptr<Ui::FlatLabel>( const auto labeled = layout->add(object_ptr<Ui::FlatLabel>(
layout, layout,
std::move(nonEmptyText), std::move(nonEmptyText),
textSt)); textSt));
std::move(text) | rpl::start_with_next([=] {
labeled->resizeToWidth(layout->width());
}, labeled->lifetime());
labeled->setSelectable(true); labeled->setSelectable(true);
layout->add(Ui::CreateSkipWidget(layout, st::infoLabelSkip)); layout->add(Ui::CreateSkipWidget(layout, st::infoLabelSkip));
const auto subtext = layout->add(object_ptr<Ui::FlatLabel>( const auto subtext = layout->add(object_ptr<Ui::FlatLabel>(