Improved style of tabs in boosts info.

This commit is contained in:
23rd 2023-11-07 03:01:12 +03:00
parent c9cabfb084
commit ee33d139cd
2 changed files with 18 additions and 3 deletions

View File

@ -4325,8 +4325,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_boosts_existing" = "Existing boosts";
"lng_boosts_premium_audience" = "Premium subscribers";
"lng_boosts_next_level" = "Boosts to level up";
"lng_boosts_list_title#one" = "{count} booster";
"lng_boosts_list_title#other" = "{count} boosters";
"lng_boosts_list_title#one" = "{count} Boost";
"lng_boosts_list_title#other" = "{count} Boosts";
"lng_boosts_list_subtext" = "Your channel is currently boosted by these users.";
"lng_boosts_show_more_boosts#one" = "Show {count} More Boosts";
"lng_boosts_show_more_boosts#other" = "Show {count} More Boosts";

View File

@ -352,11 +352,26 @@ void InnerWidget::fill() {
inner,
object_ptr<Ui::SettingsSlider>(
inner,
st::defaultTabsSlider)));
st::defaultTabsSlider)),
st::boxRowPadding);
slider->toggle(!hasOneTab, anim::type::instant);
slider->entity()->addSection(boostsTabText);
slider->entity()->addSection(giftsTabText);
{
const auto &st = st::defaultTabsSlider;
const auto sliderWidth = st.labelStyle.font->width(boostsTabText)
+ st.labelStyle.font->width(giftsTabText)
+ rect::m::sum::h(st::boxRowPadding);
fakeShowed->events() | rpl::take(1) | rpl::map_to(-1) | rpl::then(
slider->entity()->widthValue()
) | rpl::distinct_until_changed(
) | rpl::start_with_next([=](int) {
slider->entity()->resizeToWidth(sliderWidth);
}, slider->lifetime());
}
const auto boostsWrap = inner->add(
object_ptr<Ui::SlideWrap<Ui::VerticalLayout>>(
inner,