From 19e2642ec1c5a190cf82bb34c82099df0d14f840 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 13 Mar 2025 13:35:50 +0400 Subject: [PATCH] Improve paid messages in groups layout. --- .../history/view/history_view_bottom_info.cpp | 14 +++++++++----- Telegram/SourceFiles/ui/effects/credits.style | 4 ++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp b/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp index c5fde09fd9..e93a5c6faa 100644 --- a/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp +++ b/Telegram/SourceFiles/history/view/history_view_bottom_info.cpp @@ -13,6 +13,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/text/text_options.h" #include "ui/text/text_utilities.h" #include "ui/painter.h" +#include "core/ui_integration.h" #include "lang/lang_keys.h" #include "history/history_item_components.h" #include "history/history_item.h" @@ -433,15 +434,18 @@ void BottomInfo::layoutDateText() { : name.isEmpty() ? date : (name + afterAuthor); - auto marked = TextWithEntities{ full }; + auto marked = TextWithEntities(); if (const auto count = _data.stars) { - marked.append(Ui::Text::IconEmoji(&st::starIconEmoji)); - marked.append(Lang::FormatCountToShort(count).string); + marked.append( + Ui::Text::IconEmoji(&st::starIconEmojiSmall) + ).append(Lang::FormatCountToShort(count).string).append(u", "_q); } + marked.append(full); _authorEditedDate.setMarkedText( st::msgDateTextStyle, marked, - Ui::NameTextOptions()); + Ui::NameTextOptions(), + Core::TextContext({ .session = &_reactionsOwner->session() })); } void BottomInfo::layoutViewsText() { @@ -606,7 +610,7 @@ BottomInfo::Data BottomInfoDataFromMessage(not_null message) { if (item->isSending() || item->hasFailed()) { result.flags |= Flag::Sending; } - if (item->out() && !item->history()->peer->isUser()) { + if (!item->history()->peer->isUser()) { const auto media = message->media(); const auto mine = PaidInformation{ .messages = 1, diff --git a/Telegram/SourceFiles/ui/effects/credits.style b/Telegram/SourceFiles/ui/effects/credits.style index e9b20d5bb4..906f29c7da 100644 --- a/Telegram/SourceFiles/ui/effects/credits.style +++ b/Telegram/SourceFiles/ui/effects/credits.style @@ -69,6 +69,10 @@ starIconEmoji: IconEmoji { starIconEmojiColored: IconEmoji(starIconEmoji) { useIconColor: true; } +starIconEmojiSmall: IconEmoji { + icon: icon{{ "chat/mini_stars", creditsBg1 }}; + padding: margins(0px, 4px, 0px, 0px); +} creditsHistoryEntryTypeAds: icon {{ "folders/folders_channels", premiumButtonFg }};