* Constructor parent nested widgets. * @param tp Type of parent widget. * @param colour Colour of the parent widget. * @param index Index of the widget. * @param child Child container widget (if supplied). If not supplied, a * vertical container will be inserted while adding the first * child widget. */
| 2172 | * child widget. |
| 2173 | */ |
| 2174 | NWidgetBackground::NWidgetBackground(WidgetType tp, Colours colour, WidgetID index, std::unique_ptr<NWidgetPIPContainer> &&child) : NWidgetCore(tp, colour, index, 1, 1, {}, STR_NULL) |
| 2175 | { |
| 2176 | assert(tp == WWT_PANEL || tp == WWT_INSET || tp == WWT_FRAME); |
| 2177 | this->child = std::move(child); |
| 2178 | if (this->child != nullptr) this->child->parent = this; |
| 2179 | this->SetAlignment(SA_TOP | SA_LEFT); |
| 2180 | } |
| 2181 | |
| 2182 | /** |
| 2183 | * Add a child to the parent. |
nothing calls this directly
no test coverage detected