2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 07:25:46 +00:00

Fix third column profile in topics.

This commit is contained in:
John Preston
2022-10-25 12:07:47 +04:00
parent 602ba5bba9
commit 48fb410bc7
15 changed files with 63 additions and 28 deletions

View File

@@ -2194,16 +2194,24 @@ void MainWidget::updateControlsGeometry() {
anim::type::instant,
anim::activation::background);
const auto active = _controller->activeChatCurrent();
if (const auto peer = active.peer()) {
if (const auto thread = active.thread()) {
if (Core::App().settings().tabbedSelectorSectionEnabled()) {
if (_mainSection) {
_mainSection->pushTabbedSelectorToThirdSection(peer, params);
_mainSection->pushTabbedSelectorToThirdSection(
thread,
params);
} else {
_history->pushTabbedSelectorToThirdSection(peer, params);
_history->pushTabbedSelectorToThirdSection(
thread,
params);
}
} else if (Core::App().settings().thirdSectionInfoEnabled()) {
_controller->showSection(
Info::Memento::Default(peer),
(thread->asTopic()
? std::make_shared<Info::Memento>(
thread->asTopic())
: Info::Memento::Default(
thread->asHistory()->peer)),
params.withThirdColumn());
}
}
@@ -2491,11 +2499,11 @@ void MainWidget::updateThirdColumnToCurrentChat(
thirdSectionForCurrentMainSection(key),
params.withThirdColumn());
};
auto switchTabbedFast = [&](not_null<PeerData*> peer) {
auto switchTabbedFast = [&](not_null<Data::Thread*> thread) {
saveOldThirdSection();
return _mainSection
? _mainSection->pushTabbedSelectorToThirdSection(peer, params)
: _history->pushTabbedSelectorToThirdSection(peer, params);
? _mainSection->pushTabbedSelectorToThirdSection(thread, params)
: _history->pushTabbedSelectorToThirdSection(thread, params);
};
if (isThreeColumn()
&& settings.tabbedSelectorSectionEnabled()
@@ -2505,8 +2513,8 @@ void MainWidget::updateThirdColumnToCurrentChat(
settings.setTabbedSelectorSectionEnabled(true);
settings.setTabbedReplacedWithInfo(true);
} else if (settings.tabbedReplacedWithInfo()
&& key.history()
&& switchTabbedFast(key.history()->peer)) {
&& key.thread()
&& switchTabbedFast(key.thread())) {
settings.setTabbedReplacedWithInfo(false);
}
} else {