aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/StackLayout.cpp
blob: ce500b79b9bc7540a6f10bc3bde0e83f1307f76d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#include "cru/ui/controls/StackLayout.hpp"

#include "cru/ui/render/StackLayoutRenderObject.hpp"

namespace cru::ui::controls {
using render::StackLayoutRenderObject;

StackLayout::StackLayout() : render_object_(new StackLayoutRenderObject()) {
  render_object_->SetAttachedControl(this);
}

StackLayout::~StackLayout() = default;

render::RenderObject* StackLayout::GetRenderObject() const {
  return render_object_.get();
}

void StackLayout::OnAddChild(Control* child, const Index position) {
  render_object_->AddChild(child->GetRenderObject(), position);
}

void StackLayout::OnRemoveChild(Control* child, const Index position) {
  CRU_UNUSED(child)

  render_object_->RemoveChild(position);
}
}  // namespace cru::ui::controls