| 40 | Memento::~Memento() = default; |
| 41 | |
| 42 | Widget::Widget( |
| 43 | QWidget *parent, |
| 44 | not_null<Controller*> controller) |
| 45 | : ContentWidget(parent, controller) |
| 46 | , _self(controller->key().settingsSelf()) |
| 47 | , _type(controller->section().settingsType()) |
| 48 | , _inner(setupFlexibleInnerWidget( |
| 49 | _type->create( |
| 50 | this, |
| 51 | controller->parentController(), |
| 52 | scroll(), |
| 53 | controller->wrapValue( |
| 54 | ) | rpl::map([](Wrap wrap) { return (wrap == Wrap::Layer) |
| 55 | ? ::Settings::Container::Layer |
| 56 | : ::Settings::Container::Section; })), |
| 57 | _flexibleScroll, |
| 58 | [=](Ui::RpWidget*) { |
| 59 | controller->stepDataReference() = SectionCustomTopBarData{ |
| 60 | .backButtonEnables = _flexibleScroll.backButtonEnables.events(), |
| 61 | .wrapValue = controller->wrapValue(), |
| 62 | }; |
| 63 | })) |
| 64 | , _pinnedToTop(_inner->createPinnedToTop(this)) |
| 65 | , _pinnedToBottom(_inner->createPinnedToBottom(this)) { |
| 66 | _inner->sectionShowOther( |
| 67 | ) | rpl::on_next([=](Type type) { |
| 68 | controller->showSettings(type); |
| 69 | }, _inner->lifetime()); |
| 70 | |
| 71 | _inner->sectionShowBack( |
| 72 | ) | rpl::on_next([=] { |
| 73 | controller->showBackFromStack(); |
| 74 | }, _inner->lifetime()); |
| 75 | |
| 76 | _inner->setStepDataReference(controller->stepDataReference()); |
| 77 | |
| 78 | _removesFromStack.events( |
| 79 | ) | rpl::on_next([=](const std::vector<Type> &types) { |
| 80 | const auto sections = ranges::views::all( |
| 81 | types |
| 82 | ) | ranges::views::transform([](Type type) { |
| 83 | return Section(type); |
| 84 | }) | ranges::to_vector; |
| 85 | controller->removeFromStack(sections); |
| 86 | }, _inner->lifetime()); |
| 87 | |
| 88 | if (_pinnedToTop) { |
| 89 | _inner->widthValue( |
| 90 | ) | rpl::on_next([=](int w) { |
| 91 | _pinnedToTop->resizeToWidth(w); |
| 92 | setScrollTopSkip(_pinnedToTop->height()); |
| 93 | }, _pinnedToTop->lifetime()); |
| 94 | |
| 95 | _pinnedToTop->heightValue( |
| 96 | ) | rpl::on_next([=](int h) { |
| 97 | setScrollTopSkip(h); |
| 98 | }, _pinnedToTop->lifetime()); |
| 99 | } |
nothing calls this directly
no test coverage detected