From 03c24e290660bec0e077ed8f3f9fd96e591a2969 Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 5 Jun 2025 15:18:18 +0400 Subject: [PATCH] Show better monoforum chat info column. --- .../history/view/history_view_top_bar_widget.cpp | 7 +++++++ .../SourceFiles/info/profile/info_profile_widget.cpp | 9 ++++++--- Telegram/SourceFiles/mainwidget.cpp | 6 ++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp index fb20a34506..a04c003cec 100644 --- a/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_top_bar_widget.cpp @@ -394,6 +394,10 @@ void TopBarWidget::toggleInfoSection() { (_activeChat.key.topic() ? std::make_shared( _activeChat.key.topic()) + : (_activeChat.key.sublist() + && _activeChat.key.sublist()->parentChat()) + ? std::make_shared( + _activeChat.key.sublist()) : Info::Memento::Default(_activeChat.key.peer())), Window::SectionShow().withThirdColumn()); } else { @@ -1170,6 +1174,9 @@ void TopBarWidget::updateControlsVisibility() { ? true : (section == Section::Replies) ? (_activeChat.key.topic() != nullptr) + : (section == Section::SavedSublist) + ? (_activeChat.key.sublist() != nullptr + && _activeChat.key.sublist()->parentChat()) : false); updateSearchVisibility(); if (_searchMode) { diff --git a/Telegram/SourceFiles/info/profile/info_profile_widget.cpp b/Telegram/SourceFiles/info/profile/info_profile_widget.cpp index 6d0c8435fe..a11face226 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_widget.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_widget.cpp @@ -110,8 +110,9 @@ void Widget::setInnerFocus() { rpl::producer Widget::title() { if (controller()->key().topic()) { return tr::lng_info_topic_title(); - } else if (controller()->key().sublist()) { - return tr::lng_info_user_title(); + } else if (controller()->key().sublist() + && controller()->key().sublist()->parentChat()) { + return tr::lng_profile_direct_messages(); } const auto peer = controller()->key().peer(); if (const auto user = peer->asUser()) { @@ -119,7 +120,9 @@ rpl::producer Widget::title() { ? tr::lng_info_bot_title() : tr::lng_info_user_title(); } else if (const auto channel = peer->asChannel()) { - return channel->isMegagroup() + return channel->isMonoforum() + ? tr::lng_profile_direct_messages() + : channel->isMegagroup() ? tr::lng_info_group_title() : tr::lng_info_channel_title(); } else if (peer->isChat()) { diff --git a/Telegram/SourceFiles/mainwidget.cpp b/Telegram/SourceFiles/mainwidget.cpp index 65001c5cdb..a26693f680 100644 --- a/Telegram/SourceFiles/mainwidget.cpp +++ b/Telegram/SourceFiles/mainwidget.cpp @@ -2370,6 +2370,9 @@ void MainWidget::updateControlsGeometry() { (thread->asTopic() ? std::make_shared( thread->asTopic()) + : thread->asSublist() + ? std::make_shared( + thread->asSublist()) : Info::Memento::Default( thread->asHistory()->peer)), params.withThirdColumn()); @@ -2633,6 +2636,9 @@ auto MainWidget::thirdSectionForCurrentMainSection( return std::move(_thirdSectionFromStack); } else if (const auto topic = key.topic()) { return std::make_shared(topic); + } else if (const auto sublist = key.sublist() + ; sublist && sublist->parentChat()) { + return std::make_shared(sublist); } else if (const auto peer = key.peer()) { return std::make_shared( peer,