diff options
author | crupest <crupest@outlook.com> | 2022-02-09 23:53:18 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-02-09 23:53:18 +0800 |
commit | b8863c403a44c1c7ac35f1a1da92bbf3c8858552 (patch) | |
tree | 7e38f029f0657e6c1210a53f1cba331cdb8feab6 /src/ui/controls/ContentControl.cpp | |
parent | d18b5453d7ffd19667ee8ac125b34ab5328f0dc3 (diff) | |
download | cru-b8863c403a44c1c7ac35f1a1da92bbf3c8858552.tar.gz cru-b8863c403a44c1c7ac35f1a1da92bbf3c8858552.tar.bz2 cru-b8863c403a44c1c7ac35f1a1da92bbf3c8858552.zip |
...
Diffstat (limited to 'src/ui/controls/ContentControl.cpp')
-rw-r--r-- | src/ui/controls/ContentControl.cpp | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/src/ui/controls/ContentControl.cpp b/src/ui/controls/ContentControl.cpp deleted file mode 100644 index 8b421e09..00000000 --- a/src/ui/controls/ContentControl.cpp +++ /dev/null @@ -1,31 +0,0 @@ -#include "cru/ui/controls/ContentControl.h" - -namespace cru::ui::controls { -Control* ContentControl::GetChild() const { - if (GetChildren().empty()) return nullptr; - return GetChildren()[0]; -} - -void ContentControl::SetChild(Control* child) { - Control* old_child = nullptr; - if (!GetChildren().empty()) { - old_child = GetChildren()[0]; - this->RemoveChild(0); - } - if (child) { - this->AddChild(child, 0); - } - OnChildChanged(old_child, child); -} - -void ContentControl::OnChildChanged(Control* old_child, Control* new_child) { - if (container_render_object_) { - if (old_child) { - container_render_object_->RemoveChild(0); - } - if (new_child) { - container_render_object_->AddChild(new_child->GetRenderObject(), 0); - } - } -} -} // namespace cru::ui::controls |