Fixed padding reset in top bar suggestion on suggestion changed.

This commit is contained in:
23rd 2025-05-15 07:44:52 +03:00
parent 5d8ac95d07
commit 7aea200860

View file

@ -123,6 +123,7 @@ rpl::producer<Ui::SlideWrap<Ui::RpWidget>*> TopBarSuggestionValue(
const auto promo = &session->promoSuggestions(); const auto promo = &session->promoSuggestions();
if (const auto custom = promo->custom()) { if (const auto custom = promo->custom()) {
content->setRightIcon(RightIcon::Close); content->setRightIcon(RightIcon::Close);
content->setLeftPadding(0);
content->setClickedCallback([=] { content->setClickedCallback([=] {
const auto controller = FindSessionController(parent); const auto controller = FindSessionController(parent);
UrlClickHandler::Open( UrlClickHandler::Open(
@ -142,6 +143,7 @@ rpl::producer<Ui::SlideWrap<Ui::RpWidget>*> TopBarSuggestionValue(
} else if (session->premiumCanBuy() } else if (session->premiumCanBuy()
&& promo->current(kSugPremiumGrace.utf8())) { && promo->current(kSugPremiumGrace.utf8())) {
content->setRightIcon(RightIcon::Close); content->setRightIcon(RightIcon::Close);
content->setLeftPadding(0);
content->setClickedCallback([=] { content->setClickedCallback([=] {
const auto controller = FindSessionController(parent); const auto controller = FindSessionController(parent);
UrlClickHandler::Open( UrlClickHandler::Open(
@ -175,6 +177,7 @@ rpl::producer<Ui::SlideWrap<Ui::RpWidget>*> TopBarSuggestionValue(
uint64 needed, uint64 needed,
uint64 whole) { uint64 whole) {
content->setRightIcon(RightIcon::Close); content->setRightIcon(RightIcon::Close);
content->setLeftPadding(0);
content->setClickedCallback([=] { content->setClickedCallback([=] {
const auto controller = FindSessionController(parent); const auto controller = FindSessionController(parent);
controller->uiShow()->show(Box( controller->uiShow()->show(Box(
@ -372,6 +375,7 @@ rpl::producer<Ui::SlideWrap<Ui::RpWidget>*> TopBarSuggestionValue(
} else if (promo->current(kSugSetBirthday.utf8()) } else if (promo->current(kSugSetBirthday.utf8())
&& !Data::IsBirthdayToday(session->user()->birthday())) { && !Data::IsBirthdayToday(session->user()->birthday())) {
content->setRightIcon(RightIcon::Close); content->setRightIcon(RightIcon::Close);
content->setLeftPadding(0);
content->setClickedCallback([=] { content->setClickedCallback([=] {
const auto controller = FindSessionController(parent); const auto controller = FindSessionController(parent);
Core::App().openInternalUrl( Core::App().openInternalUrl(
@ -446,6 +450,7 @@ rpl::producer<Ui::SlideWrap<Ui::RpWidget>*> TopBarSuggestionValue(
}; };
if (isPremiumAnnual || isPremiumRestore || isPremiumUpgrade) { if (isPremiumAnnual || isPremiumRestore || isPremiumUpgrade) {
content->setRightIcon(RightIcon::Arrow); content->setRightIcon(RightIcon::Arrow);
content->setLeftPadding(0);
const auto api = &session->api().premium(); const auto api = &session->api().premium();
api->statusTextValue() | rpl::start_with_next([=] { api->statusTextValue() | rpl::start_with_next([=] {
for (const auto &o : api->subscriptionOptions()) { for (const auto &o : api->subscriptionOptions()) {