Fix title alignment in AskBoostBox.

This commit is contained in:
John Preston 2023-11-15 14:48:09 +04:00
parent 25216a140e
commit af6e15ed59
2 changed files with 5 additions and 4 deletions

View file

@ -28,9 +28,7 @@ namespace {
const auto exact = (data.boosts == data.thisLevelBoosts); const auto exact = (data.boosts == data.thisLevelBoosts);
const auto reached = !data.nextLevelBoosts || (exact && data.mine > 0); const auto reached = !data.nextLevelBoosts || (exact && data.mine > 0);
if (reached) { if (reached) {
if (data.nextLevelBoosts) { --data.level;
--data.level;
}
data.boosts = data.nextLevelBoosts = std::max({ data.boosts = data.nextLevelBoosts = std::max({
data.boosts, data.boosts,
data.thisLevelBoosts, data.thisLevelBoosts,
@ -483,7 +481,7 @@ void AskBoostBox(
object_ptr<Ui::FlatLabel>( object_ptr<Ui::FlatLabel>(
box, box,
std::move(title), std::move(title),
st::boostTitle), st::boostCenteredTitle),
st::boxRowPadding + QMargins(0, st::boostTitleSkip, 0, 0)); st::boxRowPadding + QMargins(0, st::boostTitleSkip, 0, 0));
box->addRow( box->addRow(
object_ptr<Ui::FlatLabel>( object_ptr<Ui::FlatLabel>(

View file

@ -258,6 +258,9 @@ boostTitleBadge: FlatLabel(defaultFlatLabel) {
textFg: premiumButtonFg; textFg: premiumButtonFg;
} }
boostTitleBadgeSkip: 6px; boostTitleBadgeSkip: 6px;
boostCenteredTitle: FlatLabel(boostTitle) {
align: align(top);
}
boostTextSkip: 5px; boostTextSkip: 5px;
boostText: FlatLabel(defaultFlatLabel) { boostText: FlatLabel(defaultFlatLabel) {
minWidth: 40px; minWidth: 40px;