mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +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>(
|
object_ptr<Ui::Premium::TopBar>(
|
||||||
box,
|
box,
|
||||||
st::giveawayGiftCodeCover,
|
st::giveawayGiftCodeCover,
|
||||||
nullptr,
|
Ui::Premium::TopBarDescriptor{
|
||||||
rpl::conditional(
|
.clickContextOther = nullptr,
|
||||||
state->used.value(),
|
.title = rpl::conditional(
|
||||||
tr::lng_gift_link_used_title(),
|
state->used.value(),
|
||||||
tr::lng_gift_link_title()),
|
tr::lng_gift_link_used_title(),
|
||||||
rpl::conditional(
|
tr::lng_gift_link_title()),
|
||||||
state->used.value(),
|
.about = rpl::conditional(
|
||||||
tr::lng_gift_link_used_about(Ui::Text::RichLangValue),
|
state->used.value(),
|
||||||
tr::lng_gift_link_about(Ui::Text::RichLangValue)),
|
tr::lng_gift_link_used_about(Ui::Text::RichLangValue),
|
||||||
true));
|
tr::lng_gift_link_about(Ui::Text::RichLangValue)),
|
||||||
|
.light = true,
|
||||||
|
}));
|
||||||
|
|
||||||
const auto max = st::giveawayGiftCodeTopHeight;
|
const auto max = st::giveawayGiftCodeTopHeight;
|
||||||
bar->setMaximumHeight(max);
|
bar->setMaximumHeight(max);
|
||||||
|
@ -1283,13 +1285,15 @@ void GiftCodePendingBox(
|
||||||
object_ptr<Ui::Premium::TopBar>(
|
object_ptr<Ui::Premium::TopBar>(
|
||||||
box,
|
box,
|
||||||
st,
|
st,
|
||||||
clickContext,
|
Ui::Premium::TopBarDescriptor{
|
||||||
tr::lng_gift_link_title(),
|
.clickContextOther = clickContext,
|
||||||
tr::lng_gift_link_pending_about(
|
.title = tr::lng_gift_link_title(),
|
||||||
lt_user,
|
.about = tr::lng_gift_link_pending_about(
|
||||||
rpl::single(Ui::Text::Link(resultToName)),
|
lt_user,
|
||||||
Ui::Text::RichLangValue),
|
rpl::single(Ui::Text::Link(resultToName)),
|
||||||
true));
|
Ui::Text::RichLangValue),
|
||||||
|
.light = true,
|
||||||
|
}));
|
||||||
|
|
||||||
const auto max = st::giveawayGiftCodeTopHeight;
|
const auto max = st::giveawayGiftCodeTopHeight;
|
||||||
bar->setMaximumHeight(max);
|
bar->setMaximumHeight(max);
|
||||||
|
|
|
@ -174,13 +174,15 @@ void AddPremiumTopBarWithDefaultTitleBar(
|
||||||
const auto bar = Ui::CreateChild<Ui::Premium::TopBar>(
|
const auto bar = Ui::CreateChild<Ui::Premium::TopBar>(
|
||||||
box.get(),
|
box.get(),
|
||||||
st::startGiveawayCover,
|
st::startGiveawayCover,
|
||||||
nullptr,
|
Ui::Premium::TopBarDescriptor{
|
||||||
tr::lng_giveaway_new_title(),
|
.clickContextOther = nullptr,
|
||||||
(group
|
.title = tr::lng_giveaway_new_title(),
|
||||||
? tr::lng_giveaway_new_about_group
|
.about = (group
|
||||||
: tr::lng_giveaway_new_about)(Ui::Text::RichLangValue),
|
? tr::lng_giveaway_new_about_group
|
||||||
true,
|
: tr::lng_giveaway_new_about)(Ui::Text::RichLangValue),
|
||||||
false);
|
.light = true,
|
||||||
|
.optimizeMinistars = false,
|
||||||
|
});
|
||||||
bar->setAttribute(Qt::WA_TransparentForMouseEvents);
|
bar->setAttribute(Qt::WA_TransparentForMouseEvents);
|
||||||
|
|
||||||
box->addRow(
|
box->addRow(
|
||||||
|
|
|
@ -1064,9 +1064,11 @@ QPointer<Ui::RpWidget> Premium::createPinnedToTop(
|
||||||
return Ui::CreateChild<Ui::Premium::TopBar>(
|
return Ui::CreateChild<Ui::Premium::TopBar>(
|
||||||
parent.get(),
|
parent.get(),
|
||||||
st::defaultPremiumCover,
|
st::defaultPremiumCover,
|
||||||
clickContextOther,
|
Ui::Premium::TopBarDescriptor{
|
||||||
std::move(title),
|
.clickContextOther = clickContextOther,
|
||||||
std::move(about));
|
.title = std::move(title),
|
||||||
|
.about = std::move(about),
|
||||||
|
});
|
||||||
}();
|
}();
|
||||||
_setPaused = [=](bool paused) {
|
_setPaused = [=](bool paused) {
|
||||||
content->setPaused(paused);
|
content->setPaused(paused);
|
||||||
|
|
|
@ -164,23 +164,6 @@ void TopBarAbstract::computeIsDark() {
|
||||||
_isDark = (contrast > kMinAcceptableContrast);
|
_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(
|
TopBar::TopBar(
|
||||||
not_null<QWidget*> parent,
|
not_null<QWidget*> parent,
|
||||||
const style::PremiumCover &st,
|
const style::PremiumCover &st,
|
||||||
|
|
|
@ -75,14 +75,6 @@ struct TopBarDescriptor {
|
||||||
|
|
||||||
class TopBar final : public TopBarAbstract {
|
class TopBar final : public TopBarAbstract {
|
||||||
public:
|
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(
|
TopBar(
|
||||||
not_null<QWidget*> parent,
|
not_null<QWidget*> parent,
|
||||||
const style::PremiumCover &st,
|
const style::PremiumCover &st,
|
||||||
|
|
Loading…
Add table
Reference in a new issue