aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/StackLayout.cpp
blob: 667e675514a2bffec6bd793a83e9af56bf7bf1cd (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
28
29
#include "cru/ui/controls/StackLayout.hpp"
#include <memory>

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

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

StackLayout::StackLayout() {
  render_object_ = std::make_unique<StackLayoutRenderObject>();
  render_object_->SetAttachedControl(this);
  SetContainerRenderObject(render_object_.get());
}

StackLayout::~StackLayout() = default;

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

const StackChildLayoutData& StackLayout::GetChildLayoutData(Index position) {
  return render_object_->GetChildLayoutData(position);
}

void StackLayout::SetChildLayoutData(Index position,
                                     StackChildLayoutData data) {
  render_object_->SetChildLayoutData(position, std::move(data));
}
}  // namespace cru::ui::controls