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

View file

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