diff --git a/Telegram/SourceFiles/info/bot/earn/info_bot_earn_list.cpp b/Telegram/SourceFiles/info/bot/earn/info_bot_earn_list.cpp index ac9bfb055..360c9c7f0 100644 --- a/Telegram/SourceFiles/info/bot/earn/info_bot_earn_list.cpp +++ b/Telegram/SourceFiles/info/bot/earn/info_bot_earn_list.cpp @@ -257,7 +257,8 @@ void InnerWidget::fill() { const auto button = BotStarRef::AddViewListButton( container, tr::lng_credits_summary_earn_title(), - tr::lng_credits_summary_earn_about()); + tr::lng_credits_summary_earn_about(), + true); button->setClickedCallback([=] { _controller->showSection(BotStarRef::Join::Make(peer())); }); 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 057e2e7c1..1b89ba525 100644 --- a/Telegram/SourceFiles/info/bot/starref/info_bot_starref_common.cpp +++ b/Telegram/SourceFiles/info/bot/starref/info_bot_starref_common.cpp @@ -34,6 +34,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/wrap/table_layout.h" #include "ui/wrap/vertical_layout.h" #include "ui/text/text_utilities.h" +#include "ui/new_badges.h" #include "ui/painter.h" #include "ui/vertical_list.h" #include "styles/style_chat.h" @@ -247,7 +248,8 @@ rpl::producer FormatForProgramDuration( not_null AddViewListButton( not_null parent, rpl::producer title, - rpl::producer subtitle) { + rpl::producer subtitle, + bool newBadge) { const auto &stLabel = st::defaultFlatLabel; const auto iconSize = st::settingsPremiumIconDouble.size(); const auto &titlePadding = st::settingsPremiumRowTitlePadding; @@ -273,6 +275,10 @@ not_null AddViewListButton( descriptionPadding); description->setAttribute(Qt::WA_TransparentForMouseEvents); + if (newBadge) { + Ui::NewBadge::AddAfterLabel(parent, label); + } + const auto dummy = Ui::CreateChild(parent); dummy->setAttribute(Qt::WA_TransparentForMouseEvents); dummy->show(); 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 3745d037a..02b8bf78e 100644 --- a/Telegram/SourceFiles/info/bot/starref/info_bot_starref_common.h +++ b/Telegram/SourceFiles/info/bot/starref/info_bot_starref_common.h @@ -51,7 +51,8 @@ using ConnectedBots = std::vector; [[nodiscard]] not_null AddViewListButton( not_null parent, rpl::producer title, - rpl::producer subtitle); + rpl::producer subtitle, + bool newBadge = false); [[nodiscard]] not_null AddFullWidthButton( not_null box, 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 21e896bcc..a46d5f375 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 @@ -967,7 +967,8 @@ void InnerWidget::fill() { const auto button = Info::BotStarRef::AddViewListButton( container, tr::lng_credits_summary_earn_title(), - tr::lng_credits_summary_earn_about()); + tr::lng_credits_summary_earn_about(), + true); button->setClickedCallback([=] { _controller->showSection(Info::BotStarRef::Join::Make(_peer)); }); diff --git a/Telegram/SourceFiles/settings/settings_credits.cpp b/Telegram/SourceFiles/settings/settings_credits.cpp index 50f1301e4..1ea023203 100644 --- a/Telegram/SourceFiles/settings/settings_credits.cpp +++ b/Telegram/SourceFiles/settings/settings_credits.cpp @@ -218,7 +218,8 @@ void Credits::setupStarRefPromo(not_null container) { const auto button = Info::BotStarRef::AddViewListButton( container, tr::lng_credits_summary_earn_title(), - tr::lng_credits_summary_earn_about()); + tr::lng_credits_summary_earn_about(), + true); button->setClickedCallback([=] { _controller->showSection(Info::BotStarRef::Join::Make(self)); });