| 2069 | } |
| 2070 | |
| 2071 | void Widget::refreshTopBars() { |
| 2072 | if (_openedFolder || _openedForum) { |
| 2073 | if (!_subsectionTopBar) { |
| 2074 | _subsectionTopBar.create(this, controller()); |
| 2075 | if (_stories) { |
| 2076 | _stories->raise(); |
| 2077 | } |
| 2078 | _subsectionTopBar->searchCancelled( |
| 2079 | ) | rpl::on_next([=] { |
| 2080 | escape(); |
| 2081 | }, _subsectionTopBar->lifetime()); |
| 2082 | _subsectionTopBar->searchSubmitted( |
| 2083 | ) | rpl::on_next([=] { |
| 2084 | submit(); |
| 2085 | }, _subsectionTopBar->lifetime()); |
| 2086 | _subsectionTopBar->searchQuery( |
| 2087 | ) | rpl::on_next([=](QString query) { |
| 2088 | applySearchUpdate(); |
| 2089 | }, _subsectionTopBar->lifetime()); |
| 2090 | _subsectionTopBar->jumpToDateRequest( |
| 2091 | ) | rpl::on_next([=] { |
| 2092 | showCalendar(); |
| 2093 | }, _subsectionTopBar->lifetime()); |
| 2094 | _subsectionTopBar->chooseFromUserRequest( |
| 2095 | ) | rpl::on_next([=] { |
| 2096 | showSearchFrom(); |
| 2097 | }, _subsectionTopBar->lifetime()); |
| 2098 | updateControlsGeometry(); |
| 2099 | } |
| 2100 | const auto history = _openedForum |
| 2101 | ? _openedForum->history().get() |
| 2102 | : nullptr; |
| 2103 | _subsectionTopBar->setActiveChat( |
| 2104 | HistoryView::TopBarWidget::ActiveChat{ |
| 2105 | .key = (_openedForum |
| 2106 | ? Dialogs::Key(history) |
| 2107 | : Dialogs::Key(_openedFolder)), |
| 2108 | .section = Dialogs::EntryState::Section::ChatsList, |
| 2109 | }, history ? history->sendActionPainter() : nullptr); |
| 2110 | if (_forumSearchRequested) { |
| 2111 | showSearchInTopBar(anim::type::instant); |
| 2112 | } |
| 2113 | } else if (_subsectionTopBar) { |
| 2114 | if (_subsectionTopBar->searchHasFocus()) { |
| 2115 | setFocus(); |
| 2116 | } |
| 2117 | _subsectionTopBar.destroy(); |
| 2118 | updateSearchFromVisibility(true); |
| 2119 | } |
| 2120 | _forumSearchRequested = false; |
| 2121 | if (_openedForum && _openedForum->peer()->isChannel()) { |
| 2122 | const auto peer = _openedForum->peer(); |
| 2123 | peer->updateFull(); |
| 2124 | |
| 2125 | _forumReportBar = std::make_unique<HistoryView::ContactStatus>( |
| 2126 | controller(), |
| 2127 | this, |
| 2128 | peer, |
nothing calls this directly
no test coverage detected