aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/flex_layout.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/controls/flex_layout.cpp')
-rw-r--r--src/ui/controls/flex_layout.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/ui/controls/flex_layout.cpp b/src/ui/controls/flex_layout.cpp
new file mode 100644
index 00000000..bdbe2d73
--- /dev/null
+++ b/src/ui/controls/flex_layout.cpp
@@ -0,0 +1,21 @@
+#include "flex_layout.hpp"
+
+#include "ui/render/flex_layout_render_object.hpp"
+
+namespace cru::ui::controls {
+using render::FlexLayoutRenderObject;
+
+FlexLayout::FlexLayout() { render_object_.reset(new FlexLayoutRenderObject()); }
+
+render::RenderObject* FlexLayout::GetRenderObject() const {
+ return render_object_.get();
+}
+
+void FlexLayout::OnAddChild(Control* child, int position) {
+ render_object_->AddChild(child->GetRenderObject(), position);
+}
+
+void FlexLayout::OnRemoveChild(Control* child, int position) {
+ render_object_->RemoveChild(position);
+}
+} // namespace cru::ui::controls