Improve star gift size in the box.

This commit is contained in:
John Preston 2024-10-10 16:26:32 +04:00
parent fdf826b686
commit 6812e17d07
2 changed files with 13 additions and 6 deletions

View file

@ -782,10 +782,13 @@ void ReceiptCreditsBox(
std::unique_ptr<Lottie::SinglePlayer> lottie;
rpl::lifetime downloadLifetime;
};
Ui::AddSkip(content, st::creditsHistoryEntryGiftStickerSpace
- (isStarGift ? st::creditsHistoryEntryGiftStickerSkip : 0));
Ui::AddSkip(content, isStarGift
? st::creditsHistoryEntryStarGiftSpace
: st::creditsHistoryEntryGiftStickerSpace);
const auto icon = Ui::CreateChild<Ui::RpWidget>(content);
icon->resize(Size(st::creditsHistoryEntryGiftStickerSize));
icon->resize(Size(isStarGift
? st::creditsHistoryEntryStarGiftSize
: st::creditsHistoryEntryGiftStickerSize));
const auto state = icon->lifetime().make_state<State>();
auto &packs = session->giftBoxStickersPacks();
const auto document = starGiftSticker
@ -834,9 +837,9 @@ void ReceiptCreditsBox(
}, icon->lifetime());
content->sizeValue(
) | rpl::start_with_next([=](const QSize &size) {
icon->move(
(size.width() - icon->width()) / 2,
isStarGift ? 0 : st::creditsHistoryEntryGiftStickerSkip);
icon->move((size.width() - icon->width()) / 2, isStarGift
? st::creditsHistoryEntryStarGiftSkip
: st::creditsHistoryEntryGiftStickerSkip);
}, icon->lifetime());
} else {
const auto widget = content->add(

View file

@ -54,6 +54,10 @@ creditsHistoryEntryGiftStickerSkip: -20px;
creditsHistoryEntryGiftStickerSize: 150px;
creditsHistoryEntryGiftStickerSpace: 105px;
creditsHistoryEntryStarGiftSkip: 10px;
creditsHistoryEntryStarGiftSize: 120px;
creditsHistoryEntryStarGiftSpace: 125px;
creditsGiftBox: Box(defaultBox) {
shadowIgnoreTopSkip: true;
}