mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Improve star gift size in the box.
This commit is contained in:
parent
fdf826b686
commit
6812e17d07
2 changed files with 13 additions and 6 deletions
|
@ -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(
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue