aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/LayoutControl.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-11-09 16:18:20 +0800
committercrupest <crupest@outlook.com>2020-11-09 16:18:20 +0800
commit349b26d350d46fd6c48c6895ee9d8ef81add1315 (patch)
tree05ad55ea728f9f5451c554f7faf7a76260aaddf8 /src/ui/controls/LayoutControl.cpp
parent12301a4e71de0802019381215a821ce58723c39a (diff)
downloadcru-349b26d350d46fd6c48c6895ee9d8ef81add1315.tar.gz
cru-349b26d350d46fd6c48c6895ee9d8ef81add1315.tar.bz2
cru-349b26d350d46fd6c48c6895ee9d8ef81add1315.zip
...
Diffstat (limited to 'src/ui/controls/LayoutControl.cpp')
-rw-r--r--src/ui/controls/LayoutControl.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/ui/controls/LayoutControl.cpp b/src/ui/controls/LayoutControl.cpp
index 85417beb..5954853e 100644
--- a/src/ui/controls/LayoutControl.cpp
+++ b/src/ui/controls/LayoutControl.cpp
@@ -1,3 +1,18 @@
#include "cru/ui/controls/LayoutControl.hpp"
-namespace cru::ui::controls {}
+#include "cru/ui/render/RenderObject.hpp"
+
+namespace cru::ui::controls {
+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