aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/stack_layout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/controls/stack_layout.cpp')
-rw-r--r--src/ui/controls/stack_layout.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/ui/controls/stack_layout.cpp b/src/ui/controls/stack_layout.cpp
new file mode 100644
index 00000000..b9abb510
--- /dev/null
+++ b/src/ui/controls/stack_layout.cpp
@@ -0,0 +1,27 @@
+#include "cru/ui/controls/stack_layout.hpp"
+
+#include "cru/ui/render/stack_layout_render_object.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, int position) {
+ render_object_->AddChild(child->GetRenderObject(), position);
+}
+
+void StackLayout::OnRemoveChild(Control* child, int position) {
+ CRU_UNUSED(child)
+
+ render_object_->RemoveChild(position);
+}
+} // namespace cru::ui::controls