| 2387 | } |
| 2388 | |
| 2389 | void MainWidget::updateControlsGeometry() { |
| 2390 | if (!width()) { |
| 2391 | return; |
| 2392 | } |
| 2393 | updateWindowAdaptiveLayout(); |
| 2394 | if (_dialogs) { |
| 2395 | const auto nochat = !_controller->mainSectionShown(); |
| 2396 | if (Core::App().settings().dialogsWidthRatio(nochat) > 0) { |
| 2397 | _a_dialogsWidth.stop(); |
| 2398 | } |
| 2399 | if (!_a_dialogsWidth.animating()) { |
| 2400 | _dialogs->stopWidthAnimation(); |
| 2401 | } |
| 2402 | } |
| 2403 | if (isThreeColumn()) { |
| 2404 | if (!_thirdSection |
| 2405 | && !_controller->takeThirdSectionFromLayer()) { |
| 2406 | auto params = Window::SectionShow( |
| 2407 | Window::SectionShow::Way::ClearStack, |
| 2408 | anim::type::instant, |
| 2409 | anim::activation::background); |
| 2410 | const auto active = _controller->activeChatCurrent(); |
| 2411 | if (const auto thread = active.thread()) { |
| 2412 | if (Core::App().settings().tabbedSelectorSectionEnabled()) { |
| 2413 | if (_mainSection) { |
| 2414 | _mainSection->pushTabbedSelectorToThirdSection( |
| 2415 | thread, |
| 2416 | params); |
| 2417 | } else { |
| 2418 | _history->pushTabbedSelectorToThirdSection( |
| 2419 | thread, |
| 2420 | params); |
| 2421 | } |
| 2422 | } else if (Core::App().settings().thirdSectionInfoEnabled()) { |
| 2423 | _controller->showSection( |
| 2424 | (thread->asTopic() |
| 2425 | ? std::make_shared<Info::Memento>( |
| 2426 | thread->asTopic()) |
| 2427 | : thread->asSublist() |
| 2428 | ? std::make_shared<Info::Memento>( |
| 2429 | thread->asSublist()) |
| 2430 | : Info::Memento::Default( |
| 2431 | thread->asHistory()->peer)), |
| 2432 | params.withThirdColumn()); |
| 2433 | } |
| 2434 | } |
| 2435 | } |
| 2436 | } else { |
| 2437 | destroyThirdSection(); |
| 2438 | _thirdShadow.destroy(); |
| 2439 | } |
| 2440 | const auto mainSectionTop = getMainSectionTop(); |
| 2441 | auto dialogsWidth = _dialogs |
| 2442 | ? qRound(_a_dialogsWidth.value(_dialogsWidth)) |
| 2443 | : isOneColumn() |
| 2444 | ? width() |
| 2445 | : 0; |
| 2446 | if (isOneColumn()) { |
no test coverage detected