From ab27005dfceb37cf9972355f85cd0fdf430b7469 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sun, 1 Feb 2026 09:56:49 +0300 Subject: [PATCH] Replaced NewBotThreadDownIcon with lambda. --- .../history/view/history_view_about_view.cpp | 46 ++++++------------- 1 file changed, 14 insertions(+), 32 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_about_view.cpp b/Telegram/SourceFiles/history/view/history_view_about_view.cpp index 050a702c76..842c73fea9 100644 --- a/Telegram/SourceFiles/history/view/history_view_about_view.cpp +++ b/Telegram/SourceFiles/history/view/history_view_about_view.cpp @@ -155,18 +155,6 @@ private: }; -class NewBotThreadDownIcon final : public MediaGenericPart { -public: - void draw( - Painter &p, - not_null owner, - const PaintContext &context, - int outerWidth) const override; - QSize countOptimalSize() override; - QSize countCurrentSize(int newWidth) override; - -}; - UserpicsList::UserpicsList( std::vector> peers, const style::GroupCallUserpics &st, @@ -227,26 +215,7 @@ int UserpicsList::width() const { return _st.size + (shifted * (_st.size - _st.shift)); } -void NewBotThreadDownIcon::draw( - Painter &p, - not_null owner, - const PaintContext &context, - int outerWidth) const { - auto color = context.st->msgServiceFg()->c; - color.setAlphaF(color.alphaF() * kLabelOpacity); - st::newBotThreadDown.paintInCenter( - p, - QRect(0, 0, outerWidth, st::newBotThreadDown.height()), - color); -} -QSize NewBotThreadDownIcon::countOptimalSize() { - return st::newBotThreadDown.size(); -} - -QSize NewBotThreadDownIcon::countCurrentSize(int newWidth) { - return st::newBotThreadDown.size(); -} NewBotThreadDottedLine::NewBotThreadDottedLine(not_null parent) : _parent(parent) { @@ -392,7 +361,20 @@ auto GenerateNewBotThread( })); pushText(tr::bold(title), st::chatIntroTitleMargin); pushText({ description }, st::chatIntroMargin); - push(std::make_unique()); + push(std::make_unique( + st::newBotThreadDown.size() / 4 * 3, + [=, h = st::newBotThreadDown.height() / 2 + st::lineWidth * 4]( + Painter &p, + not_null owner, + const PaintContext &context, + int outerWidth) { + auto color = context.st->msgServiceFg()->c; + color.setAlphaF(color.alphaF() * kLabelOpacity); + st::newBotThreadDown.paintInCenter( + p, + QRect(0, 0, outerWidth, h), + color); + })); parent->addVerticalMargins( st::newBotThreadTopSkip - st::msgServiceMargin.top(),