| 337 | } |
| 338 | |
| 339 | Widget::Widget( |
| 340 | QWidget *parent, |
| 341 | not_null<Window::SessionController*> controller, |
| 342 | Layout layout) |
| 343 | : Window::AbstractSectionWidget(parent, controller, nullptr) |
| 344 | , _api(&controller->session().mtp()) |
| 345 | , _chooseByDragTimer([=] { _inner->chooseRow(); }) |
| 346 | , _layout(layout) |
| 347 | , _narrowWidth(st::defaultDialogRow.padding.left() |
| 348 | + st::defaultDialogRow.photoSize |
| 349 | + st::defaultDialogRow.padding.left()) |
| 350 | , _searchControls(this) |
| 351 | , _mainMenu({ |
| 352 | .toggle = object_ptr<Ui::IconButton>( |
| 353 | _searchControls, |
| 354 | st::dialogsMenuToggle), |
| 355 | .under = object_ptr<Ui::AbstractButton>(_searchControls), |
| 356 | }) |
| 357 | , _searchForNarrowLayout(_searchControls, st::dialogsSearchForNarrowFilters) |
| 358 | , _search(_searchControls, st::dialogsFilter, tr::lng_dlg_filter()) |
| 359 | , _chooseFromUser( |
| 360 | _searchControls, |
| 361 | object_ptr<Ui::IconButton>(this, st::dialogsSearchFrom)) |
| 362 | , _jumpToDate( |
| 363 | _searchControls, |
| 364 | object_ptr<Ui::IconButton>(this, st::dialogsCalendar)) |
| 365 | , _cancelSearch(_searchControls, st::dialogsCancelSearch) |
| 366 | , _lockUnlock( |
| 367 | _searchControls, |
| 368 | object_ptr<Ui::IconButton>(this, st::dialogsLock)) |
| 369 | , _scroll(this) |
| 370 | , _scrollToTop(_scroll, st::dialogsToUp) |
| 371 | , _stories((_layout != Layout::Child) |
| 372 | ? std::make_unique<Stories::List>( |
| 373 | this, |
| 374 | st::dialogsStoriesList, |
| 375 | _storiesContents.events() | rpl::flatten_latest()) |
| 376 | : nullptr) |
| 377 | , _searchTimer([=] { search(); }) |
| 378 | , _peerSearch(&controller->session(), Api::PeerSearch::Type::WithSponsored) |
| 379 | , _singleMessageSearch(&controller->session()) { |
| 380 | const auto makeChildListShown = [](PeerId peerId, float64 shown) { |
| 381 | return InnerWidget::ChildListShown{ peerId, shown }; |
| 382 | }; |
| 383 | using OverscrollType = Ui::ElasticScroll::OverscrollType; |
| 384 | _scroll->setOverscrollTypes( |
| 385 | _stories ? OverscrollType::Virtual : OverscrollType::Real, |
| 386 | OverscrollType::Real); |
| 387 | _innerList = _scroll->setOwnedWidget( |
| 388 | object_ptr<Ui::VerticalLayout>(this)); |
| 389 | _inner = _innerList->add(object_ptr<InnerWidget>( |
| 390 | _innerList, |
| 391 | controller, |
| 392 | rpl::combine( |
| 393 | _childListPeerId.value(), |
| 394 | _childListShown.value(), |
| 395 | makeChildListShown))); |
| 396 | rpl::combine( |
nothing calls this directly
no test coverage detected