Show right icon in top reactors.

This commit is contained in:
John Preston 2024-08-09 17:38:03 +02:00
parent 49e6c4f552
commit d1313f38eb
5 changed files with 10 additions and 4 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 349 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 565 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 740 B

View file

@ -128,8 +128,10 @@ void PaidReactionSlider(
[[nodiscard]] QImage GenerateBadgeImage(int count) {
const auto text = Lang::FormatCountDecimal(count);
const auto length = st::chatSimilarBadgeFont->width(text);
const auto contents = length
+ st::chatSimilarLockedIcon.width();
const auto contents = st::chatSimilarLockedIconPosition.x()
+ st::paidReactTopStarIcon.width()
+ st::paidReactTopStarSkip
+ length;
const auto badge = QRect(
st::chatSimilarBadgePadding.left(),
st::chatSimilarBadgePadding.top(),
@ -146,7 +148,7 @@ void PaidReactionSlider(
const auto &font = st::chatSimilarBadgeFont;
const auto textTop = badge.y() + font->ascent;
const auto icon = &st::chatSimilarLockedIcon;
const auto icon = &st::paidReactTopStarIcon;
const auto position = st::chatSimilarLockedIconPosition;
auto hq = PainterHighQualityEnabler(q);
@ -162,7 +164,7 @@ void PaidReactionSlider(
badge.x() + position.x(),
badge.y() + position.y(),
rect.width());
textLeft += position.x() + icon->width();
textLeft += position.x() + icon->width() + st::paidReactTopStarSkip;
}
q.setFont(font);

View file

@ -398,6 +398,10 @@ paidReactToastLabel: FlatLabel(defaultFlatLabel) {
textFg: toastFg;
palette: defaultToastPalette;
}
paidReactTopStarIcon: icon{{ "chat/mini_stars", premiumButtonFg }};
paidReactTopStarIconPosition: point(0px, 1px);
paidReactTopStarSkip: 4px;
toastUndoStroke: 2px;
toastUndoSpace: 8px;
toastUndoDiameter: 20px;