aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/LayoutControl.cpp
blob: 5c67bc86b6df9633f98864dadfba8f627f8869b6 (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
#include "cru/ui/controls/LayoutControl.h"

#include "cru/ui/render/RenderObject.h"

namespace cru::ui::controls {
void LayoutControl::ClearChildren() {
  while (GetChildren().size() > 0) {
    RemoveChild(0);
  }
}

void LayoutControl::OnAddChild(Control* child, Index position) {
  if (container_render_object_ != nullptr) {
    container_render_object_->AddChild(child->GetRenderObject(), position);
  }
}

void LayoutControl::OnRemoveChild(Control* child, Index position) {
  CRU_UNUSED(child)
  if (container_render_object_ != nullptr) {
    container_render_object_->RemoveChild(position);
  }
}
}  // namespace cru::ui::controls