From b0e2f948a90bf7d49ddee95fb86a817c99dee923 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sun, 1 Feb 2026 09:48:43 +0300 Subject: [PATCH] Added icon to new thread about view for bots with forum. --- Telegram/Resources/icons/chat/new_thread.svg | 3 +++ .../history/view/history_view_about_view.cpp | 26 ++++++++++++++++++- Telegram/SourceFiles/ui/chat/chat.style | 5 ++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 Telegram/Resources/icons/chat/new_thread.svg diff --git a/Telegram/Resources/icons/chat/new_thread.svg b/Telegram/Resources/icons/chat/new_thread.svg new file mode 100644 index 0000000000..bcf13e4ce5 --- /dev/null +++ b/Telegram/Resources/icons/chat/new_thread.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/Telegram/SourceFiles/history/view/history_view_about_view.cpp b/Telegram/SourceFiles/history/view/history_view_about_view.cpp index edf9fcda96..050a702c76 100644 --- a/Telegram/SourceFiles/history/view/history_view_about_view.cpp +++ b/Telegram/SourceFiles/history/view/history_view_about_view.cpp @@ -366,6 +366,30 @@ auto GenerateNewBotThread( const auto title = tr::lng_bot_new_thread_title(tr::now); const auto description = tr::lng_bot_new_thread_about(tr::now); push(std::make_unique(parent)); + push(std::make_unique( + QSize( + st::newThreadAboutIconOuter, + st::newThreadAboutIconOuter + st::newThreadAboutIconSkip), + [=]( + Painter &p, + not_null owner, + const PaintContext &context, + int outerWidth) { + const auto size = st::newThreadAboutIconOuter; + const auto &icon = st::newThreadAboutIcon; + const auto x = (outerWidth - icon.width()) / 2; + const auto y = (size - icon.height()) / 2 + + st::newThreadAboutIconSkip; + p.setPen(Qt::NoPen); + p.setBrush(context.st->msgServiceBgSelected()); + p.drawEllipse( + (outerWidth - size) / 2, + st::newThreadAboutIconSkip, + size, + size); + const auto color = context.st->msgServiceFg(); + icon.paint(p, x, y, outerWidth, color->c); + })); pushText(tr::bold(title), st::chatIntroTitleMargin); pushText({ description }, st::chatIntroMargin); push(std::make_unique()); @@ -1030,7 +1054,7 @@ AdminLog::OwnedItem AboutView::makeNewBotThread() { result.get(), GenerateNewBotThread(result.get(), _item.get()), HistoryView::MediaGenericDescriptor{ - .maxWidth = st::chatIntroWidth, + .maxWidth = st::newThreadAboutMaxWidth, .service = true, .hideServiceText = true, })); diff --git a/Telegram/SourceFiles/ui/chat/chat.style b/Telegram/SourceFiles/ui/chat/chat.style index 0b0f5a0178..5c697f6bfd 100644 --- a/Telegram/SourceFiles/ui/chat/chat.style +++ b/Telegram/SourceFiles/ui/chat/chat.style @@ -1501,6 +1501,11 @@ messageGiftIconSkip: 30px; newChatIcon: icon{{ "chat/new_topic", windowFgActive }}; newChatIconPadding: margins(2px, 2px, 2px, 2px); +newThreadAboutMaxWidth: 180px; +newThreadAboutIconSkip: chatIntroTitleMargin.top; +newThreadAboutIconOuter: 60px; +newThreadAboutIcon: icon{{ "chat/new_thread-40x40", windowFgActive }}; + stakeBox: Box(defaultBox) { buttonPadding: margins(24px, 12px, 24px, 24px); buttonHeight: 42px;