| 19 | } |
| 20 | |
| 21 | View::View(std::shared_ptr<ViewCoreFactory> viewCoreFactory) |
| 22 | : _viewCoreFactory(viewCoreFactory ? std::move(viewCoreFactory) |
| 23 | : UIApplicationController::ViewCoreFactoryStack::top()) |
| 24 | { |
| 25 | if (!_viewCoreFactory) { |
| 26 | throw std::runtime_error("Couldn't get ViewCore Factory!"); |
| 27 | } |
| 28 | |
| 29 | stylesheet.onChange() += [=](auto &property) { |
| 30 | updateFromStylesheet(); |
| 31 | if (auto layout = _layout.get()) { |
| 32 | layout->updateStylesheet(this); |
| 33 | } |
| 34 | }; |
| 35 | |
| 36 | isLayoutRoot.onChange() += [=](auto) { updateLayout(_layout.get(), _layout.get()); }; |
| 37 | |
| 38 | visible.onChange() += [=](auto) { |
| 39 | if (auto layout = _layout.get()) { |
| 40 | layout->updateStylesheet(this); |
| 41 | } |
| 42 | }; |
| 43 | |
| 44 | registerCoreCreatingProperties(this, &visible, &geometry, &stylesheet); |
| 45 | } |
| 46 | |
| 47 | View::~View() |
| 48 | { |
nothing calls this directly
no test coverage detected