diff options
Diffstat (limited to 'src/ui/controls/Control.cpp')
-rw-r--r-- | src/ui/controls/Control.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/ui/controls/Control.cpp b/src/ui/controls/Control.cpp index df71f660..ba43b2b8 100644 --- a/src/ui/controls/Control.cpp +++ b/src/ui/controls/Control.cpp @@ -1,15 +1,11 @@ #include "cru/ui/controls/Control.h" -#include "cru/common/Base.h" #include "cru/platform/gui/Cursor.h" #include "cru/platform/gui/UiApplication.h" -#include "cru/ui/Base.h" #include "cru/ui/host/WindowHost.h" #include "cru/ui/render/RenderObject.h" #include "cru/ui/style/StyleRuleSet.h" -#include <memory> - namespace cru::ui::controls { using platform::gui::ICursor; using platform::gui::IUiApplication; @@ -48,6 +44,12 @@ void Control::SetParent(Control* parent) { OnParentChanged(old_parent, parent); } +void Control::RemoveFromParent() { + if (parent_) { + parent_->RemoveChild(this); + } +} + bool Control::HasFocus() { auto host = GetWindowHost(); if (host == nullptr) return false; |