aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/flex_layout.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2019-03-20 19:26:55 +0800
committercrupest <crupest@outlook.com>2019-03-20 19:26:55 +0800
commit616ebd78b543876388cb3d64f108abea041d4983 (patch)
tree8cae90f29695a3bd534b3ae5e32218d79719ba91 /src/ui/controls/flex_layout.cpp
parentd518396a7fcdb2add413a9a37bb34515ff4f4cc4 (diff)
downloadcru-616ebd78b543876388cb3d64f108abea041d4983.tar.gz
cru-616ebd78b543876388cb3d64f108abea041d4983.tar.bz2
cru-616ebd78b543876388cb3d64f108abea041d4983.zip
...
Diffstat (limited to 'src/ui/controls/flex_layout.cpp')
-rw-r--r--src/ui/controls/flex_layout.cpp19
1 files changed, 19 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..ebe61a6d
--- /dev/null
+++ b/src/ui/controls/flex_layout.cpp
@@ -0,0 +1,19 @@
+#include "flex_layout.hpp"
+
+#include "ui/render/flex_layout_render_object.hpp"
+
+namespace cru::ui::controls {
+using render::FlexLayoutRenderObject;
+
+FlexLayout::FlexLayout() { render_object_ = new FlexLayoutRenderObject(); }
+
+FlexLayout::~FlexLayout() { delete render_object_; }
+
+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