aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/container.cpp
blob: 4695ad4cde54667ab9991caa734c936d093738ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include "cru/ui/controls/container.hpp"

#include "cru/platform/graph/factory.hpp"
#include "cru/ui/render/border_render_object.hpp"

namespace cru::ui::controls {
Container::Container() {
  render_object_ = std::make_unique<render::BorderRenderObject>();
  render_object_->SetBorderEnabled(false);
}

Container::~Container() = default;

void Container::OnChildChanged(Control* old_child, Control* new_child) {
  render_object_->RemoveChild(0);
  render_object_->AddChild(new_child->GetRenderObject(), 0);
}
}  // namespace cru::ui::controls