2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Topics list in forum chats list entry.

This commit is contained in:
John Preston
2022-11-11 13:24:37 +04:00
parent 996b6bf46a
commit 4c8187f623
15 changed files with 395 additions and 97 deletions

View File

@@ -216,17 +216,11 @@ void PaintListEntryText(
row->listEntryCache().draw(p, {
.position = rect.topLeft(),
.availableWidth = rect.width(),
.palette = &(row->folder()
? (context.active
? st::dialogsTextPaletteArchiveActive
: context.selected
? st::dialogsTextPaletteArchiveOver
: st::dialogsTextPaletteArchive)
: (context.active
? st::dialogsTextPaletteActive
: context.selected
? st::dialogsTextPaletteOver
: st::dialogsTextPalette)),
.palette = &(context.active
? st::dialogsTextPaletteArchiveActive
: context.selected
? st::dialogsTextPaletteArchiveOver
: st::dialogsTextPaletteArchive),
.spoiler = Text::DefaultSpoilerCache(),
.now = context.now,
.paused = context.paused,
@@ -897,7 +891,7 @@ void RowPainter::Paint(
: context.selected
? st::dialogsTextFgServiceOver
: st::dialogsTextFgService;
const auto rect = QRect(
auto rect = QRect(
nameleft,
texttop,
availableWidth,
@@ -926,6 +920,13 @@ void RowPainter::Paint(
[=] { entry->updateChatListEntry(); },
{ .ignoreTopic = (!history || !peer->isForum()) });
}
if (const auto topics = context.st->topicsHeight) {
view->prepareTopics(
row->history()->peer->forum(),
rect,
[=] { entry->updateChatListEntry(); });
rect.setHeight(topics + rect.height());
}
view->paint(p, rect, context);
}
};