aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/Container.cpp
blob: 8b15c56639d4bba55bb84f6758ca89d8adaff46e (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/graphics/Factory.hpp"
#include "cru/ui/render/BorderRenderObject.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*, Control* new_child) {
  render_object_->RemoveChild(0);
  render_object_->AddChild(new_child->GetRenderObject(), 0);
}
}  // namespace cru::ui::controls