mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-07-27 07:52:57 +02:00
Show better monoforum chat info column.
This commit is contained in:
parent
dc61faace1
commit
03c24e2906
3 changed files with 19 additions and 3 deletions
|
@ -394,6 +394,10 @@ void TopBarWidget::toggleInfoSection() {
|
|||
(_activeChat.key.topic()
|
||||
? std::make_shared<Info::Memento>(
|
||||
_activeChat.key.topic())
|
||||
: (_activeChat.key.sublist()
|
||||
&& _activeChat.key.sublist()->parentChat())
|
||||
? std::make_shared<Info::Memento>(
|
||||
_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) {
|
||||
|
|
|
@ -110,8 +110,9 @@ void Widget::setInnerFocus() {
|
|||
rpl::producer<QString> 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<QString> 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()) {
|
||||
|
|
|
@ -2370,6 +2370,9 @@ void MainWidget::updateControlsGeometry() {
|
|||
(thread->asTopic()
|
||||
? std::make_shared<Info::Memento>(
|
||||
thread->asTopic())
|
||||
: thread->asSublist()
|
||||
? std::make_shared<Info::Memento>(
|
||||
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<Info::Memento>(topic);
|
||||
} else if (const auto sublist = key.sublist()
|
||||
; sublist && sublist->parentChat()) {
|
||||
return std::make_shared<Info::Memento>(sublist);
|
||||
} else if (const auto peer = key.peer()) {
|
||||
return std::make_shared<Info::Memento>(
|
||||
peer,
|
||||
|
|
Loading…
Add table
Reference in a new issue