diff --git a/Telegram/SourceFiles/calls/group/calls_group_common.cpp b/Telegram/SourceFiles/calls/group/calls_group_common.cpp index 69c028cdce..030ba2bdf5 100644 --- a/Telegram/SourceFiles/calls/group/calls_group_common.cpp +++ b/Telegram/SourceFiles/calls/group/calls_group_common.cpp @@ -223,18 +223,13 @@ void ConferenceCallJoinConfirm( style::al_top )->setTryMakeSimilarLines(true); } - const auto joinAndClose = [=] { + box->addButton(tr::lng_confcall_join_button(), [=] { join([weak = base::make_weak(box)] { if (const auto strong = weak.get()) { strong->closeBox(); } }); - }; - Info::BotStarRef::AddFullWidthButton( - box, - tr::lng_confcall_join_button(), - joinAndClose, - &st::confcallLinkButton); + }); } ConferenceCallLinkStyleOverrides DarkConferenceCallLinkStyle() { diff --git a/Telegram/SourceFiles/info/bot/starref/info_bot_starref_common.cpp b/Telegram/SourceFiles/info/bot/starref/info_bot_starref_common.cpp index 935a3ff499..a434e2aeab 100644 --- a/Telegram/SourceFiles/info/bot/starref/info_bot_starref_common.cpp +++ b/Telegram/SourceFiles/info/bot/starref/info_bot_starref_common.cpp @@ -340,34 +340,6 @@ not_null AddViewListButton( return button; } -not_null AddFullWidthButton( - not_null box, - rpl::producer text, - Fn callback, - const style::RoundButton *stOverride) { - const auto &boxSt = box->getDelegate()->style(); - const auto result = box->addButton( - std::move(text), - std::move(callback), - stOverride ? *stOverride : boxSt.button); - rpl::combine( - box->widthValue(), - result->widthValue() - ) | rpl::on_next([=](int width, int buttonWidth) { - const auto correct = width - - boxSt.buttonPadding.left() - - boxSt.buttonPadding.right(); - if (correct > 0 && buttonWidth != correct) { - result->resizeToWidth(correct); - result->moveToLeft( - boxSt.buttonPadding.left(), - boxSt.buttonPadding.top(), - width); - } - }, result->lifetime()); - return result; -} - void AddFullWidthButtonFooter( not_null box, not_null button, @@ -494,11 +466,11 @@ object_ptr StarRefLinkBox( }; }; preview->setClickedCallback(copy(false)); - const auto button = AddFullWidthButton( - box, + const auto button = box->addButton( tr::lng_star_ref_link_copy(), - copy(true), - &st::starrefCopyButton); + [=] { copy(true); }, + st::starrefCopyButton); + const auto name = TextWithEntities{ bot->name() }; AddFullWidthButtonFooter( box, @@ -712,8 +684,7 @@ object_ptr JoinStarRefBox( show->showToast(u"Failed: "_q + error); }); }; - const auto button = AddFullWidthButton( - box, + const auto button = box->addButton( tr::lng_star_ref_one_join(), send); AddFullWidthButtonFooter( diff --git a/Telegram/SourceFiles/info/bot/starref/info_bot_starref_common.h b/Telegram/SourceFiles/info/bot/starref/info_bot_starref_common.h index a48586b1be..e38bdd1c5a 100644 --- a/Telegram/SourceFiles/info/bot/starref/info_bot_starref_common.h +++ b/Telegram/SourceFiles/info/bot/starref/info_bot_starref_common.h @@ -55,12 +55,6 @@ using ConnectedBots = std::vector; rpl::producer subtitle, bool newBadge = false); -not_null AddFullWidthButton( - not_null box, - rpl::producer text, - Fn callback = nullptr, - const style::RoundButton *stOverride = nullptr); - void AddFullWidthButtonFooter( not_null box, not_null button, diff --git a/Telegram/SourceFiles/ui/effects/premium.style b/Telegram/SourceFiles/ui/effects/premium.style index 298e315055..85677accc3 100644 --- a/Telegram/SourceFiles/ui/effects/premium.style +++ b/Telegram/SourceFiles/ui/effects/premium.style @@ -494,6 +494,7 @@ starrefFooterButton: RoundButton(defaultActiveButton) { starrefFooterBox: Box(defaultBox) { buttonPadding: margins(22px, 11px, 22px, 54px); buttonHeight: 42px; + buttonWide: true; button: starrefFooterButton; shadowIgnoreTopSkip: true; }