From 7886a2179f5ae719827acf946362476bf07ca725 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 21 Mar 2024 13:43:10 +0400 Subject: [PATCH] Fix giveaway messages layout. --- .../history/view/media/history_view_giveaway.cpp | 7 ++++--- Telegram/SourceFiles/ui/chat/chat.style | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history/view/media/history_view_giveaway.cpp b/Telegram/SourceFiles/history/view/media/history_view_giveaway.cpp index 5942f3d69..041b1c256 100644 --- a/Telegram/SourceFiles/history/view/media/history_view_giveaway.cpp +++ b/Telegram/SourceFiles/history/view/media/history_view_giveaway.cpp @@ -482,7 +482,8 @@ std::unique_ptr StickerWithBadgePart::stickerTakePlayer( } QSize StickerWithBadgePart::countOptimalSize() { - return _sticker.countOptimalSize(); + _sticker.initDimensions(); + return { _sticker.maxWidth(), _sticker.minHeight() }; } QSize StickerWithBadgePart::countCurrentSize(int newWidth) { @@ -788,7 +789,7 @@ auto GenerateGiveawayStart( parent, nullptr, sticker, - QMargins(0, st::chatGiveawayStickerTop, 0, 0), + st::chatGiveawayStickerPadding, tr::lng_prizes_badge( tr::now, lt_amount, @@ -925,7 +926,7 @@ auto GenerateGiveawayResults( parent, nullptr, sticker, - QMargins(0, st::chatGiveawayStickerTop, 0, 0), + st::chatGiveawayStickerPadding, tr::lng_prizes_badge( tr::now, lt_amount, diff --git a/Telegram/SourceFiles/ui/chat/chat.style b/Telegram/SourceFiles/ui/chat/chat.style index dba8a16ea..8b294604d 100644 --- a/Telegram/SourceFiles/ui/chat/chat.style +++ b/Telegram/SourceFiles/ui/chat/chat.style @@ -1001,6 +1001,7 @@ storyMentionButtonSkip: 5px; chatGiveawayWidth: 292px; chatGiveawayStickerTop: -16px; +chatGiveawayStickerPadding: margins(14px, -2px, 14px, 14px); chatGiveawayWinnersTopSkip: 25px; chatGiveawayBadgeFont: font(12px bold); chatGiveawayBadgeTop: 106px;