* Construct a nested widget tree from an array of parts. * @param nwid_parts Span of nested widget parts. * @param container Container to add the nested widgets to. In case it is nullptr a vertical container is used. * @return Root of the nested widget tree, a vertical container containing the entire GUI. * @ingroup NestedWidgetParts */
| 3408 | * @ingroup NestedWidgetParts |
| 3409 | */ |
| 3410 | std::unique_ptr<NWidgetBase> MakeNWidgets(std::span<const NWidgetPart> nwid_parts, std::unique_ptr<NWidgetBase> &&container) |
| 3411 | { |
| 3412 | if (container == nullptr) container = std::make_unique<NWidgetVertical>(); |
| 3413 | [[maybe_unused]] auto nwid_part = MakeWidgetTree(std::begin(nwid_parts), std::end(nwid_parts), container); |
| 3414 | #ifdef WITH_ASSERT |
| 3415 | if (nwid_part != std::end(nwid_parts)) [[unlikely]] throw std::runtime_error("Did not consume all NWidgetParts"); |
| 3416 | #endif |
| 3417 | return std::move(container); |
| 3418 | } |
| 3419 | |
| 3420 | /** |
| 3421 | * Make a nested widget tree for a window from a parts array. Besides loading, it inserts a shading selection widget |
no test coverage detected