From 06d1d0442276a05b6caad6e3468f4afb1e8ee5df Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 28 Jun 2020 00:03:11 +0800 Subject: ... --- src/ui/controls/Container.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/ui/controls/Container.cpp (limited to 'src/ui/controls/Container.cpp') diff --git a/src/ui/controls/Container.cpp b/src/ui/controls/Container.cpp new file mode 100644 index 00000000..de58ee64 --- /dev/null +++ b/src/ui/controls/Container.cpp @@ -0,0 +1,18 @@ +#include "cru/ui/controls/Container.hpp" + +#include "cru/platform/graph/Factory.hpp" +#include "cru/ui/render/BorderRenderObject.hpp" + +namespace cru::ui::controls { +Container::Container() { + render_object_ = std::make_unique(); + render_object_->SetBorderEnabled(false); +} + +Container::~Container() = default; + +void Container::OnChildChanged(Control*, Control* new_child) { + render_object_->RemoveChild(0); + render_object_->AddChild(new_child->GetRenderObject(), 0); +} +} // namespace cru::ui::controls -- cgit v1.2.3