From af6e15ed59b1abef20fa6703f80fe02a43587179 Mon Sep 17 00:00:00 2001 From: John Preston Date: Wed, 15 Nov 2023 14:48:09 +0400 Subject: [PATCH] Fix title alignment in AskBoostBox. --- Telegram/SourceFiles/ui/boxes/boost_box.cpp | 6 ++---- Telegram/SourceFiles/ui/effects/premium.style | 3 +++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/ui/boxes/boost_box.cpp b/Telegram/SourceFiles/ui/boxes/boost_box.cpp index 0be48632ca..66b1761fa3 100644 --- a/Telegram/SourceFiles/ui/boxes/boost_box.cpp +++ b/Telegram/SourceFiles/ui/boxes/boost_box.cpp @@ -28,9 +28,7 @@ namespace { const auto exact = (data.boosts == data.thisLevelBoosts); const auto reached = !data.nextLevelBoosts || (exact && data.mine > 0); if (reached) { - if (data.nextLevelBoosts) { - --data.level; - } + --data.level; data.boosts = data.nextLevelBoosts = std::max({ data.boosts, data.thisLevelBoosts, @@ -483,7 +481,7 @@ void AskBoostBox( object_ptr( box, std::move(title), - st::boostTitle), + st::boostCenteredTitle), st::boxRowPadding + QMargins(0, st::boostTitleSkip, 0, 0)); box->addRow( object_ptr( diff --git a/Telegram/SourceFiles/ui/effects/premium.style b/Telegram/SourceFiles/ui/effects/premium.style index 69c356610a..b847e5cc81 100644 --- a/Telegram/SourceFiles/ui/effects/premium.style +++ b/Telegram/SourceFiles/ui/effects/premium.style @@ -258,6 +258,9 @@ boostTitleBadge: FlatLabel(defaultFlatLabel) { textFg: premiumButtonFg; } boostTitleBadgeSkip: 6px; +boostCenteredTitle: FlatLabel(boostTitle) { + align: align(top); +} boostTextSkip: 5px; boostText: FlatLabel(defaultFlatLabel) { minWidth: 40px;