Added icon to new thread about view for bots with forum.

This commit is contained in:
23rd
2026-02-01 09:48:43 +03:00
parent 42f38b042f
commit b0e2f948a9
3 changed files with 33 additions and 1 deletions
@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 72 72">
<path fill="#FFFFFF" fill-rule="evenodd" d="M55,37C62.732,37 69,43.268 69,51C69,58.732 62.732,65 55,65C47.268,65 41,58.732 41,51C41,43.268 47.268,37 55,37ZM36,7C52.569,7 66,19.234 66,34.325C66,35.114 65.963,35.895 65.891,36.667C62.867,34.366 59.093,33 55,33C45.059,33 37,41.059 37,51C37,54.863 38.217,58.442 40.288,61.374C38.888,61.556 37.456,61.651 36,61.651C31.929,61.651 28.047,60.912 24.507,59.574C23.5,60.389 22.256,61.163 20.777,61.895C16.779,63.874 12.723,64.458 8.606,63.645C7.977,63.521 7.568,62.91 7.692,62.281C7.731,62.086 7.819,61.903 7.949,61.752C10.634,58.619 11.966,54.919 11.944,50.654C8.21,46.099 6,40.447 6,34.325C6,19.234 19.431,7 36,7ZM55,42.419C53.872,42.419 52.957,43.334 52.957,44.462L52.956,48.956L48.462,48.957C47.334,48.957 46.419,49.872 46.419,51C46.419,52.128 47.334,53.043 48.462,53.043L52.956,53.042L52.957,57.538C52.957,58.666 53.872,59.581 55,59.581C56.128,59.581 57.043,58.666 57.043,57.538L57.042,53.042L61.538,53.043C62.666,53.043 63.581,52.128 63.581,51C63.581,49.872 62.666,48.957 61.538,48.957L57.042,48.956L57.043,44.462C57.043,43.334 56.128,42.419 55,42.419Z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@@ -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<NewBotThreadDottedLine>(parent));
push(std::make_unique<LambdaGenericPart>(
QSize(
st::newThreadAboutIconOuter,
st::newThreadAboutIconOuter + st::newThreadAboutIconSkip),
[=](
Painter &p,
not_null<const MediaGeneric*> 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<NewBotThreadDownIcon>());
@@ -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,
}));
+5
View File
@@ -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;