Skip to content

Commit

Permalink
Improve star gift size in the box.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Oct 11, 2024
1 parent fdf826b commit 6812e17
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
15 changes: 9 additions & 6 deletions Telegram/SourceFiles/settings/settings_credits_graphics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 4 additions & 0 deletions Telegram/SourceFiles/ui/effects/credits.style
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ creditsHistoryEntryGiftStickerSkip: -20px;
creditsHistoryEntryGiftStickerSize: 150px;
creditsHistoryEntryGiftStickerSpace: 105px;

creditsHistoryEntryStarGiftSkip: 10px;
creditsHistoryEntryStarGiftSize: 120px;
creditsHistoryEntryStarGiftSpace: 125px;

creditsGiftBox: Box(defaultBox) {
shadowIgnoreTopSkip: true;
}
Expand Down

0 comments on commit 6812e17

Please sign in to comment.