diff options
author | crupest <crupest@outlook.com> | 2022-02-10 19:26:19 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-02-10 19:26:19 +0800 |
commit | b2622f654598f82a220a98daaa84fed9ce3b92b2 (patch) | |
tree | 544d5a9a52d7530bf54e888d3fabd79ff85bfdb7 /include/cru/ui/controls/SingleChildControl.h | |
parent | b8863c403a44c1c7ac35f1a1da92bbf3c8858552 (diff) | |
download | cru-b2622f654598f82a220a98daaa84fed9ce3b92b2.tar.gz cru-b2622f654598f82a220a98daaa84fed9ce3b92b2.tar.bz2 cru-b2622f654598f82a220a98daaa84fed9ce3b92b2.zip |
...
Diffstat (limited to 'include/cru/ui/controls/SingleChildControl.h')
-rw-r--r-- | include/cru/ui/controls/SingleChildControl.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/cru/ui/controls/SingleChildControl.h b/include/cru/ui/controls/SingleChildControl.h index 037d6dd3..d40d7a27 100644 --- a/include/cru/ui/controls/SingleChildControl.h +++ b/include/cru/ui/controls/SingleChildControl.h @@ -48,8 +48,14 @@ class CRU_UI_API SingleChildControl : public Control { } } + void RemoveChild(Control* child) override { + if (child_ == child) { + SetChild(nullptr); + } + } + private: - Control* child_; + Control* child_ = nullptr; std::unique_ptr<TRenderObject> container_render_object_; }; } // namespace cru::ui::controls |