mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 22:54:01 +02:00
Add a NEW badge to "Earn Stars".
This commit is contained in:
parent
1fd1e34844
commit
42a2de4bf0
5 changed files with 15 additions and 5 deletions
|
@ -257,7 +257,8 @@ void InnerWidget::fill() {
|
||||||
const auto button = BotStarRef::AddViewListButton(
|
const auto button = BotStarRef::AddViewListButton(
|
||||||
container,
|
container,
|
||||||
tr::lng_credits_summary_earn_title(),
|
tr::lng_credits_summary_earn_title(),
|
||||||
tr::lng_credits_summary_earn_about());
|
tr::lng_credits_summary_earn_about(),
|
||||||
|
true);
|
||||||
button->setClickedCallback([=] {
|
button->setClickedCallback([=] {
|
||||||
_controller->showSection(BotStarRef::Join::Make(peer()));
|
_controller->showSection(BotStarRef::Join::Make(peer()));
|
||||||
});
|
});
|
||||||
|
|
|
@ -34,6 +34,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
#include "ui/wrap/table_layout.h"
|
#include "ui/wrap/table_layout.h"
|
||||||
#include "ui/wrap/vertical_layout.h"
|
#include "ui/wrap/vertical_layout.h"
|
||||||
#include "ui/text/text_utilities.h"
|
#include "ui/text/text_utilities.h"
|
||||||
|
#include "ui/new_badges.h"
|
||||||
#include "ui/painter.h"
|
#include "ui/painter.h"
|
||||||
#include "ui/vertical_list.h"
|
#include "ui/vertical_list.h"
|
||||||
#include "styles/style_chat.h"
|
#include "styles/style_chat.h"
|
||||||
|
@ -247,7 +248,8 @@ rpl::producer<TextWithEntities> FormatForProgramDuration(
|
||||||
not_null<Ui::AbstractButton*> AddViewListButton(
|
not_null<Ui::AbstractButton*> AddViewListButton(
|
||||||
not_null<Ui::VerticalLayout*> parent,
|
not_null<Ui::VerticalLayout*> parent,
|
||||||
rpl::producer<QString> title,
|
rpl::producer<QString> title,
|
||||||
rpl::producer<QString> subtitle) {
|
rpl::producer<QString> subtitle,
|
||||||
|
bool newBadge) {
|
||||||
const auto &stLabel = st::defaultFlatLabel;
|
const auto &stLabel = st::defaultFlatLabel;
|
||||||
const auto iconSize = st::settingsPremiumIconDouble.size();
|
const auto iconSize = st::settingsPremiumIconDouble.size();
|
||||||
const auto &titlePadding = st::settingsPremiumRowTitlePadding;
|
const auto &titlePadding = st::settingsPremiumRowTitlePadding;
|
||||||
|
@ -273,6 +275,10 @@ not_null<Ui::AbstractButton*> AddViewListButton(
|
||||||
descriptionPadding);
|
descriptionPadding);
|
||||||
description->setAttribute(Qt::WA_TransparentForMouseEvents);
|
description->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||||
|
|
||||||
|
if (newBadge) {
|
||||||
|
Ui::NewBadge::AddAfterLabel(parent, label);
|
||||||
|
}
|
||||||
|
|
||||||
const auto dummy = Ui::CreateChild<Ui::AbstractButton>(parent);
|
const auto dummy = Ui::CreateChild<Ui::AbstractButton>(parent);
|
||||||
dummy->setAttribute(Qt::WA_TransparentForMouseEvents);
|
dummy->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||||
dummy->show();
|
dummy->show();
|
||||||
|
|
|
@ -51,7 +51,8 @@ using ConnectedBots = std::vector<ConnectedBot>;
|
||||||
[[nodiscard]] not_null<Ui::AbstractButton*> AddViewListButton(
|
[[nodiscard]] not_null<Ui::AbstractButton*> AddViewListButton(
|
||||||
not_null<Ui::VerticalLayout*> parent,
|
not_null<Ui::VerticalLayout*> parent,
|
||||||
rpl::producer<QString> title,
|
rpl::producer<QString> title,
|
||||||
rpl::producer<QString> subtitle);
|
rpl::producer<QString> subtitle,
|
||||||
|
bool newBadge = false);
|
||||||
|
|
||||||
[[nodiscard]] not_null<Ui::RoundButton*> AddFullWidthButton(
|
[[nodiscard]] not_null<Ui::RoundButton*> AddFullWidthButton(
|
||||||
not_null<Ui::BoxContent*> box,
|
not_null<Ui::BoxContent*> box,
|
||||||
|
|
|
@ -967,7 +967,8 @@ void InnerWidget::fill() {
|
||||||
const auto button = Info::BotStarRef::AddViewListButton(
|
const auto button = Info::BotStarRef::AddViewListButton(
|
||||||
container,
|
container,
|
||||||
tr::lng_credits_summary_earn_title(),
|
tr::lng_credits_summary_earn_title(),
|
||||||
tr::lng_credits_summary_earn_about());
|
tr::lng_credits_summary_earn_about(),
|
||||||
|
true);
|
||||||
button->setClickedCallback([=] {
|
button->setClickedCallback([=] {
|
||||||
_controller->showSection(Info::BotStarRef::Join::Make(_peer));
|
_controller->showSection(Info::BotStarRef::Join::Make(_peer));
|
||||||
});
|
});
|
||||||
|
|
|
@ -218,7 +218,8 @@ void Credits::setupStarRefPromo(not_null<Ui::VerticalLayout*> container) {
|
||||||
const auto button = Info::BotStarRef::AddViewListButton(
|
const auto button = Info::BotStarRef::AddViewListButton(
|
||||||
container,
|
container,
|
||||||
tr::lng_credits_summary_earn_title(),
|
tr::lng_credits_summary_earn_title(),
|
||||||
tr::lng_credits_summary_earn_about());
|
tr::lng_credits_summary_earn_about(),
|
||||||
|
true);
|
||||||
button->setClickedCallback([=] {
|
button->setClickedCallback([=] {
|
||||||
_controller->showSection(Info::BotStarRef::Join::Make(self));
|
_controller->showSection(Info::BotStarRef::Join::Make(self));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Add table
Reference in a new issue