diff --git a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp index 55feed317..cc9351480 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_actions.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_actions.cpp @@ -1064,16 +1064,19 @@ object_ptr DetailsFiller::setupInfo() { not_null button, not_null label) { const auto parent = label->parentWidget(); - result->sizeValue() | rpl::start_with_next([=] { + rpl::combine( + label->geometryValue(), + button->sizeValue() + ) | rpl::start_with_next([=](const QRect &, const QSize &buttonSize) { const auto s = parent->size(); button->moveToRight( 0, - (s.height() - button->height()) / 2); + (s.height() - buttonSize.height()) / 2); label->resizeToWidth( s.width() - label->geometry().left() - st::lineWidth * 2 - - button->width()); + - buttonSize.width()); }, button->lifetime()); }; const auto controller = _controller->parentController(); @@ -1177,11 +1180,11 @@ object_ptr DetailsFiller::setupInfo() { usernameLine.text->setContextMenuHook(lnkHook); usernameLine.subtext->setContextMenuHook(lnkHook); - const auto copyUsername = Ui::CreateChild( + const auto qrButton = Ui::CreateChild( usernameLine.text->parentWidget(), st::infoProfileLabeledButtonQr); - fitLabelToButton(copyUsername, usernameLine.text); - copyUsername->setClickedCallback([=] { + fitLabelToButton(qrButton, usernameLine.text); + qrButton->setClickedCallback([=] { controller->show( Box(Ui::FillPeerQrBox, user, std::nullopt, nullptr)); return false;