From 50f9f36c3de6579d90e9d505f463a77b0527439b Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sun, 18 Aug 2024 13:02:39 +0300 Subject: [PATCH] Fixed padding for history entries in channel earn section. --- .../channel_statistics/earn/info_channel_earn_list.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp b/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp index ebaf61e21..51cf9506a 100644 --- a/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp +++ b/Telegram/SourceFiles/info/channel_statistics/earn/info_channel_earn_list.cpp @@ -1012,8 +1012,7 @@ void InnerWidget::fill() { not_null listsContainer) { const auto hasCurrencyTab = !data.currencyEarn.firstHistorySlice.list.empty(); - const auto hasCreditsTab = !data.creditsStatusSlice.list.empty() - && data.premiumBotId; + const auto hasCreditsTab = !data.creditsStatusSlice.list.empty(); const auto hasOneTab = (hasCurrencyTab || hasCreditsTab) && (hasCurrencyTab != hasCreditsTab); @@ -1029,7 +1028,9 @@ void InnerWidget::fill() { listsContainer, st::defaultTabsSlider)), st::boxRowPadding); - slider->toggle(!hasOneTab, anim::type::instant); + slider->toggle( + ((hasCurrencyTab ? 1 : 0) + (hasCreditsTab ? 1 : 0) > 1), + anim::type::instant); if (hasCurrencyTab) { slider->entity()->addSection(currencyTabText); @@ -1053,11 +1054,13 @@ void InnerWidget::fill() { if (hasOneTab) { if (hasCurrencyTab) { AddHeader(listsContainer, tr::lng_channel_earn_history_title); + AddSkip(listsContainer); } else if (hasCreditsTab) { AddHeader( listsContainer, tr::lng_channel_earn_credits_history); slider->entity()->setActiveSectionFast(1); + AddSkip(listsContainer); } } else { slider->entity()->setActiveSectionFast(*sectionIndex);