mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 14:17:12 +02:00
Removed redundant constructor from Ui::Premium::TopBar.
This commit is contained in:
parent
ac2f35f12b
commit
bc7aa91fbb
5 changed files with 35 additions and 52 deletions
|
@ -1147,16 +1147,18 @@ void GiftCodeBox(
|
|||
object_ptr<Ui::Premium::TopBar>(
|
||||
box,
|
||||
st::giveawayGiftCodeCover,
|
||||
nullptr,
|
||||
rpl::conditional(
|
||||
state->used.value(),
|
||||
tr::lng_gift_link_used_title(),
|
||||
tr::lng_gift_link_title()),
|
||||
rpl::conditional(
|
||||
state->used.value(),
|
||||
tr::lng_gift_link_used_about(Ui::Text::RichLangValue),
|
||||
tr::lng_gift_link_about(Ui::Text::RichLangValue)),
|
||||
true));
|
||||
Ui::Premium::TopBarDescriptor{
|
||||
.clickContextOther = nullptr,
|
||||
.title = rpl::conditional(
|
||||
state->used.value(),
|
||||
tr::lng_gift_link_used_title(),
|
||||
tr::lng_gift_link_title()),
|
||||
.about = rpl::conditional(
|
||||
state->used.value(),
|
||||
tr::lng_gift_link_used_about(Ui::Text::RichLangValue),
|
||||
tr::lng_gift_link_about(Ui::Text::RichLangValue)),
|
||||
.light = true,
|
||||
}));
|
||||
|
||||
const auto max = st::giveawayGiftCodeTopHeight;
|
||||
bar->setMaximumHeight(max);
|
||||
|
@ -1283,13 +1285,15 @@ void GiftCodePendingBox(
|
|||
object_ptr<Ui::Premium::TopBar>(
|
||||
box,
|
||||
st,
|
||||
clickContext,
|
||||
tr::lng_gift_link_title(),
|
||||
tr::lng_gift_link_pending_about(
|
||||
lt_user,
|
||||
rpl::single(Ui::Text::Link(resultToName)),
|
||||
Ui::Text::RichLangValue),
|
||||
true));
|
||||
Ui::Premium::TopBarDescriptor{
|
||||
.clickContextOther = clickContext,
|
||||
.title = tr::lng_gift_link_title(),
|
||||
.about = tr::lng_gift_link_pending_about(
|
||||
lt_user,
|
||||
rpl::single(Ui::Text::Link(resultToName)),
|
||||
Ui::Text::RichLangValue),
|
||||
.light = true,
|
||||
}));
|
||||
|
||||
const auto max = st::giveawayGiftCodeTopHeight;
|
||||
bar->setMaximumHeight(max);
|
||||
|
|
|
@ -174,13 +174,15 @@ void AddPremiumTopBarWithDefaultTitleBar(
|
|||
const auto bar = Ui::CreateChild<Ui::Premium::TopBar>(
|
||||
box.get(),
|
||||
st::startGiveawayCover,
|
||||
nullptr,
|
||||
tr::lng_giveaway_new_title(),
|
||||
(group
|
||||
? tr::lng_giveaway_new_about_group
|
||||
: tr::lng_giveaway_new_about)(Ui::Text::RichLangValue),
|
||||
true,
|
||||
false);
|
||||
Ui::Premium::TopBarDescriptor{
|
||||
.clickContextOther = nullptr,
|
||||
.title = tr::lng_giveaway_new_title(),
|
||||
.about = (group
|
||||
? tr::lng_giveaway_new_about_group
|
||||
: tr::lng_giveaway_new_about)(Ui::Text::RichLangValue),
|
||||
.light = true,
|
||||
.optimizeMinistars = false,
|
||||
});
|
||||
bar->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||
|
||||
box->addRow(
|
||||
|
|
|
@ -1064,9 +1064,11 @@ QPointer<Ui::RpWidget> Premium::createPinnedToTop(
|
|||
return Ui::CreateChild<Ui::Premium::TopBar>(
|
||||
parent.get(),
|
||||
st::defaultPremiumCover,
|
||||
clickContextOther,
|
||||
std::move(title),
|
||||
std::move(about));
|
||||
Ui::Premium::TopBarDescriptor{
|
||||
.clickContextOther = clickContextOther,
|
||||
.title = std::move(title),
|
||||
.about = std::move(about),
|
||||
});
|
||||
}();
|
||||
_setPaused = [=](bool paused) {
|
||||
content->setPaused(paused);
|
||||
|
|
|
@ -164,23 +164,6 @@ void TopBarAbstract::computeIsDark() {
|
|||
_isDark = (contrast > kMinAcceptableContrast);
|
||||
}
|
||||
|
||||
TopBar::TopBar(
|
||||
not_null<QWidget*> parent,
|
||||
const style::PremiumCover &st,
|
||||
Fn<QVariant()> clickContextOther,
|
||||
rpl::producer<QString> title,
|
||||
rpl::producer<TextWithEntities> about,
|
||||
bool light,
|
||||
bool optimizeMinistars)
|
||||
: TopBar(parent, st, {
|
||||
.clickContextOther = std::move(clickContextOther),
|
||||
.title = std::move(title),
|
||||
.about = std::move(about),
|
||||
.light = light,
|
||||
.optimizeMinistars = optimizeMinistars,
|
||||
}) {
|
||||
}
|
||||
|
||||
TopBar::TopBar(
|
||||
not_null<QWidget*> parent,
|
||||
const style::PremiumCover &st,
|
||||
|
|
|
@ -75,14 +75,6 @@ struct TopBarDescriptor {
|
|||
|
||||
class TopBar final : public TopBarAbstract {
|
||||
public:
|
||||
TopBar(
|
||||
not_null<QWidget*> parent,
|
||||
const style::PremiumCover &st,
|
||||
Fn<QVariant()> clickContextOther,
|
||||
rpl::producer<QString> title,
|
||||
rpl::producer<TextWithEntities> about,
|
||||
bool light = false,
|
||||
bool optimizeMinistars = true);
|
||||
TopBar(
|
||||
not_null<QWidget*> parent,
|
||||
const style::PremiumCover &st,
|
||||
|
|
Loading…
Add table
Reference in a new issue