2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Improve top bar design for forum / topic.

This commit is contained in:
John Preston
2022-10-20 15:14:55 +04:00
parent 3a967bbbfe
commit f9173ea849
5 changed files with 62 additions and 16 deletions

View File

@@ -707,14 +707,16 @@ void Widget::refreshFolderTopBar() {
_folderTopBar.create(this, controller());
updateControlsGeometry();
}
const auto history = _openedForum
? session().data().history(_openedForum).get()
: nullptr;
_folderTopBar->setActiveChat(
HistoryView::TopBarWidget::ActiveChat{
.key = (_openedForum
? Dialogs::Key(session().data().history(_openedForum))
? Dialogs::Key(history)
: Dialogs::Key(_openedFolder)),
.section = Dialogs::EntryState::Section::ChatsList,
},
nullptr);
}, history ? history->sendActionPainter().get() : nullptr);
} else {
_folderTopBar.destroy();
}

View File

@@ -822,7 +822,10 @@ void RowPainter::Paint(
const auto badgesState = entry->chatListBadgesState();
const auto item = entry->chatListMessage();
const auto cloudDraft = [&]() -> const Data::Draft*{
if (thread && (!item || !badgesState.unread)) {
if (!thread) {
return nullptr;
}
if ((!peer || !peer->isForum()) && (!item || !badgesState.unread)) {
// Draw item, if there are unread messages.
const auto draft = thread->owningHistory()->cloudDraft(
thread->topicRootId());