mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-09-01 06:55:58 +00:00
Show better monoforum chat info column.
This commit is contained in:
@@ -394,6 +394,10 @@ void TopBarWidget::toggleInfoSection() {
|
|||||||
(_activeChat.key.topic()
|
(_activeChat.key.topic()
|
||||||
? std::make_shared<Info::Memento>(
|
? std::make_shared<Info::Memento>(
|
||||||
_activeChat.key.topic())
|
_activeChat.key.topic())
|
||||||
|
: (_activeChat.key.sublist()
|
||||||
|
&& _activeChat.key.sublist()->parentChat())
|
||||||
|
? std::make_shared<Info::Memento>(
|
||||||
|
_activeChat.key.sublist())
|
||||||
: Info::Memento::Default(_activeChat.key.peer())),
|
: Info::Memento::Default(_activeChat.key.peer())),
|
||||||
Window::SectionShow().withThirdColumn());
|
Window::SectionShow().withThirdColumn());
|
||||||
} else {
|
} else {
|
||||||
@@ -1170,6 +1174,9 @@ void TopBarWidget::updateControlsVisibility() {
|
|||||||
? true
|
? true
|
||||||
: (section == Section::Replies)
|
: (section == Section::Replies)
|
||||||
? (_activeChat.key.topic() != nullptr)
|
? (_activeChat.key.topic() != nullptr)
|
||||||
|
: (section == Section::SavedSublist)
|
||||||
|
? (_activeChat.key.sublist() != nullptr
|
||||||
|
&& _activeChat.key.sublist()->parentChat())
|
||||||
: false);
|
: false);
|
||||||
updateSearchVisibility();
|
updateSearchVisibility();
|
||||||
if (_searchMode) {
|
if (_searchMode) {
|
||||||
|
@@ -110,8 +110,9 @@ void Widget::setInnerFocus() {
|
|||||||
rpl::producer<QString> Widget::title() {
|
rpl::producer<QString> Widget::title() {
|
||||||
if (controller()->key().topic()) {
|
if (controller()->key().topic()) {
|
||||||
return tr::lng_info_topic_title();
|
return tr::lng_info_topic_title();
|
||||||
} else if (controller()->key().sublist()) {
|
} else if (controller()->key().sublist()
|
||||||
return tr::lng_info_user_title();
|
&& controller()->key().sublist()->parentChat()) {
|
||||||
|
return tr::lng_profile_direct_messages();
|
||||||
}
|
}
|
||||||
const auto peer = controller()->key().peer();
|
const auto peer = controller()->key().peer();
|
||||||
if (const auto user = peer->asUser()) {
|
if (const auto user = peer->asUser()) {
|
||||||
@@ -119,7 +120,9 @@ rpl::producer<QString> Widget::title() {
|
|||||||
? tr::lng_info_bot_title()
|
? tr::lng_info_bot_title()
|
||||||
: tr::lng_info_user_title();
|
: tr::lng_info_user_title();
|
||||||
} else if (const auto channel = peer->asChannel()) {
|
} 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_group_title()
|
||||||
: tr::lng_info_channel_title();
|
: tr::lng_info_channel_title();
|
||||||
} else if (peer->isChat()) {
|
} else if (peer->isChat()) {
|
||||||
|
@@ -2370,6 +2370,9 @@ void MainWidget::updateControlsGeometry() {
|
|||||||
(thread->asTopic()
|
(thread->asTopic()
|
||||||
? std::make_shared<Info::Memento>(
|
? std::make_shared<Info::Memento>(
|
||||||
thread->asTopic())
|
thread->asTopic())
|
||||||
|
: thread->asSublist()
|
||||||
|
? std::make_shared<Info::Memento>(
|
||||||
|
thread->asSublist())
|
||||||
: Info::Memento::Default(
|
: Info::Memento::Default(
|
||||||
thread->asHistory()->peer)),
|
thread->asHistory()->peer)),
|
||||||
params.withThirdColumn());
|
params.withThirdColumn());
|
||||||
@@ -2633,6 +2636,9 @@ auto MainWidget::thirdSectionForCurrentMainSection(
|
|||||||
return std::move(_thirdSectionFromStack);
|
return std::move(_thirdSectionFromStack);
|
||||||
} else if (const auto topic = key.topic()) {
|
} else if (const auto topic = key.topic()) {
|
||||||
return std::make_shared<Info::Memento>(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()) {
|
} else if (const auto peer = key.peer()) {
|
||||||
return std::make_shared<Info::Memento>(
|
return std::make_shared<Info::Memento>(
|
||||||
peer,
|
peer,
|
||||||
|
Reference in New Issue
Block a user