| 293 | } |
| 294 | |
| 295 | InnerWidget::InnerWidget( |
| 296 | QWidget *parent, |
| 297 | not_null<Window::SessionController*> controller, |
| 298 | rpl::producer<ChildListShown> childListShown) |
| 299 | : RpWidget(parent) |
| 300 | , _controller(controller) |
| 301 | , _shownList(controller->session().data().chatsList()->indexed()) |
| 302 | , _st(&st::defaultDialogRow) |
| 303 | , _pinnedShiftAnimation([=](crl::time now) { |
| 304 | return pinnedShiftAnimationCallback(now); |
| 305 | }) |
| 306 | , _narrowWidth(st::defaultDialogRow.padding.left() |
| 307 | + st::defaultDialogRow.photoSize |
| 308 | + st::defaultDialogRow.padding.left()) |
| 309 | , _childListShown(std::move(childListShown)) |
| 310 | , _freezeTimer([=] { _shownList->unfreeze(); update(); }) { |
| 311 | setAttribute(Qt::WA_OpaquePaintEvent, true); |
| 312 | setAccessibleName(tr::lng_recent_chats(tr::now)); |
| 313 | |
| 314 | style::PaletteChanged( |
| 315 | ) | rpl::on_next([=] { |
| 316 | _topicJumpCache = nullptr; |
| 317 | _chatsFilterTags.clear(); |
| 318 | _rightButtons.clear(); |
| 319 | _pressedRightButtonData = nullptr; |
| 320 | for (const auto &result : _peerSearchResults) { |
| 321 | if (const auto sponsored = result->sponsored.get()) { |
| 322 | sponsored->button = {}; |
| 323 | } |
| 324 | } |
| 325 | }, lifetime()); |
| 326 | |
| 327 | session().downloaderTaskFinished( |
| 328 | ) | rpl::on_next([=] { |
| 329 | update(); |
| 330 | }, lifetime()); |
| 331 | |
| 332 | Core::App().notifications().settingsChanged( |
| 333 | ) | rpl::on_next([=](Window::Notifications::ChangeType change) { |
| 334 | if (change == Window::Notifications::ChangeType::CountMessages) { |
| 335 | // Folder rows change their unread badge with this setting. |
| 336 | update(); |
| 337 | } |
| 338 | }, lifetime()); |
| 339 | |
| 340 | session().data().contactsLoaded().changes( |
| 341 | ) | rpl::on_next([=] { |
| 342 | refresh(); |
| 343 | refreshEmpty(); |
| 344 | }, lifetime()); |
| 345 | |
| 346 | session().data().itemRemoved( |
| 347 | ) | rpl::on_next([=](not_null<const HistoryItem*> item) { |
| 348 | itemRemoved(item); |
| 349 | }, lifetime()); |
| 350 | |
| 351 | session().data().dialogsRowReplacements( |
| 352 | ) | rpl::on_next([=](Data::Session::DialogsRowReplacement r) { |
nothing calls this directly
no test coverage detected