| 254 | } |
| 255 | |
| 256 | MainWidget::MainWidget( |
| 257 | QWidget *parent, |
| 258 | not_null<Window::SessionController*> controller) |
| 259 | : RpWidget(parent) |
| 260 | , _controller(controller) |
| 261 | , _dialogsWidth(st::columnMinimalWidthLeft) |
| 262 | , _thirdColumnWidth(st::columnMinimalWidthThird) |
| 263 | , _dialogs(windowId().hasChatsList() |
| 264 | ? base::make_unique_q<Dialogs::Widget>( |
| 265 | this, |
| 266 | _controller, |
| 267 | Dialogs::Widget::Layout::Main) |
| 268 | : nullptr) |
| 269 | , _history(std::in_place, this, _controller) |
| 270 | , _sideShadow(_dialogs |
| 271 | ? base::make_unique_q<Ui::PlainShadow>(this) |
| 272 | : nullptr) |
| 273 | , _playerPlaylist(this, _controller) |
| 274 | , _changelogs(Core::Changelogs::Create(&controller->session())) { |
| 275 | if (_dialogs) { |
| 276 | setupConnectingWidget(); |
| 277 | } |
| 278 | |
| 279 | _history->cancelRequests( |
| 280 | ) | rpl::on_next([=] { |
| 281 | handleHistoryBack(); |
| 282 | }, lifetime()); |
| 283 | |
| 284 | Core::App().calls().currentCallValue( |
| 285 | ) | rpl::on_next([=](Calls::Call *call) { |
| 286 | setCurrentCall(call); |
| 287 | }, lifetime()); |
| 288 | Core::App().calls().currentGroupCallValue( |
| 289 | ) | rpl::on_next([=](Calls::GroupCall *call) { |
| 290 | setCurrentGroupCall(call); |
| 291 | }, lifetime()); |
| 292 | if (_callTopBar) { |
| 293 | _callTopBar->finishAnimating(); |
| 294 | } |
| 295 | |
| 296 | controller->window().setDefaultFloatPlayerDelegate( |
| 297 | floatPlayerDelegate()); |
| 298 | |
| 299 | Core::App().floatPlayerClosed( |
| 300 | ) | rpl::on_next([=](FullMsgId itemId) { |
| 301 | floatPlayerClosed(itemId); |
| 302 | }, lifetime()); |
| 303 | |
| 304 | Core::App().exportManager().currentView( |
| 305 | ) | rpl::on_next([=](Export::View::PanelController *view) { |
| 306 | setCurrentExportView(view); |
| 307 | }, lifetime()); |
| 308 | if (_exportTopBar) { |
| 309 | _exportTopBar->finishAnimating(); |
| 310 | } |
| 311 | |
| 312 | Media::Player::instance()->closePlayerRequests( |
| 313 | ) | rpl::on_next([=] { |
nothing calls this directly
no test coverage detected