Use known gift number in some places.
This commit is contained in:
@@ -1004,22 +1004,32 @@ void PreviewBox(
|
||||
st::settingsPremiumTopBarClose);
|
||||
close->setClickedCallback([=] { box->closeBox(); });
|
||||
|
||||
const auto left = Ui::CreateChild<Ui::IconButton>(
|
||||
const auto gifts = (state->selected.current() == PremiumFeature::Gifts);
|
||||
|
||||
const auto left = gifts ? nullptr : Ui::CreateChild<Ui::IconButton>(
|
||||
buttonsParent,
|
||||
st::settingsPremiumMoveLeft);
|
||||
left->setClickedCallback([=] { move(-1); });
|
||||
if (left) {
|
||||
left->setClickedCallback([=] { move(-1); });
|
||||
}
|
||||
|
||||
const auto right = Ui::CreateChild<Ui::IconButton>(
|
||||
const auto right = gifts ? nullptr : Ui::CreateChild<Ui::IconButton>(
|
||||
buttonsParent,
|
||||
st::settingsPremiumMoveRight);
|
||||
right->setClickedCallback([=] { move(1); });
|
||||
if (right) {
|
||||
right->setClickedCallback([=] { move(1); });
|
||||
}
|
||||
|
||||
buttonsParent->widthValue(
|
||||
) | rpl::start_with_next([=](int width) {
|
||||
const auto outerHeight = st::premiumPreviewHeight;
|
||||
close->moveToRight(0, 0, width);
|
||||
left->moveToLeft(0, (outerHeight - left->height()) / 2, width);
|
||||
right->moveToRight(0, (outerHeight - right->height()) / 2, width);
|
||||
if (left) {
|
||||
left->moveToLeft(0, (outerHeight - left->height()) / 2, width);
|
||||
}
|
||||
if (right) {
|
||||
right->moveToRight(0, (outerHeight - right->height()) / 2, width);
|
||||
}
|
||||
}, close->lifetime());
|
||||
|
||||
state->preload = [=] {
|
||||
@@ -1148,7 +1158,6 @@ void PreviewBox(
|
||||
style::al_top
|
||||
)->setTryMakeSimilarLines(true);
|
||||
|
||||
const auto gifts = (state->selected.current() == PremiumFeature::Gifts);
|
||||
if (gifts) {
|
||||
box->setStyle(st::giftBox);
|
||||
AddGiftsInfoRows(box->verticalLayout());
|
||||
|
||||
@@ -1182,14 +1182,17 @@ void AuctionGotGiftsBox(
|
||||
st::giveawayGiftCodeValueMargin);
|
||||
};
|
||||
|
||||
// Title "Round #n"
|
||||
addFullWidth(tr::lng_auction_bought_round(
|
||||
// Title "Gift #number in round #n"
|
||||
addFullWidth(tr::lng_auction_bought_in_round(
|
||||
lt_name,
|
||||
rpl::single(tr::marked(
|
||||
emoji
|
||||
).append(' ').append(
|
||||
Data::UniqueGiftName(gift.resellTitle, entry.number)
|
||||
)),
|
||||
lt_n,
|
||||
rpl::single(tr::marked(QString::number(entry.round))),
|
||||
tr::bold
|
||||
) | rpl::map([=](const TextWithEntities &text) {
|
||||
return TextWithEntities{ emoji }.append(' ').append(text);
|
||||
}));
|
||||
tr::bold));
|
||||
|
||||
// Recipient
|
||||
AddTableRow(
|
||||
|
||||
Reference in New Issue
Block a user