From c4f45c4b7c8646beec52392222a22aa9e868dabd Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 5 Aug 2024 19:00:16 +0300 Subject: [PATCH] Fixed resizing of label in section of profile info. --- .../SourceFiles/info/profile/info_profile_text.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/info/profile/info_profile_text.cpp b/Telegram/SourceFiles/info/profile/info_profile_text.cpp index b09e35484..bfca3d053 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_text.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_text.cpp @@ -29,11 +29,9 @@ TextWithLabel CreateTextWithLabel( parent, object_ptr(parent), padding); - result->setDuration( - st::infoSlideDuration - ); + result->setDuration(st::infoSlideDuration); auto layout = result->entity(); - auto nonEmptyText = std::move( + auto nonEmptyText = rpl::duplicate( text ) | rpl::before_next([slide = result.data()]( const TextWithEntities &value) { @@ -46,10 +44,13 @@ TextWithLabel CreateTextWithLabel( const TextWithEntities &value) { slide->show(anim::type::normal); }); - auto labeled = layout->add(object_ptr( + const auto labeled = layout->add(object_ptr( layout, std::move(nonEmptyText), textSt)); + std::move(text) | rpl::start_with_next([=] { + labeled->resizeToWidth(layout->width()); + }, labeled->lifetime()); labeled->setSelectable(true); layout->add(Ui::CreateSkipWidget(layout, st::infoLabelSkip)); const auto subtext = layout->add(object_ptr(