diff options
Diffstat (limited to 'src/ui/controls/Control.cpp')
| -rw-r--r-- | src/ui/controls/Control.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/ui/controls/Control.cpp b/src/ui/controls/Control.cpp index 548c9726..57937da2 100644 --- a/src/ui/controls/Control.cpp +++ b/src/ui/controls/Control.cpp @@ -111,6 +111,14 @@ void Control::InsertChildAt(Control* control, Index index) { OnChildInserted(control, index); if (host_) { + control->TraverseDescendents( + [this](Control* control) { + control->ControlHostChangeEvent_.Raise({nullptr, host_}); + }, + true); + } + + if (host_) { host_->ScheduleRelayout(); } } @@ -132,6 +140,14 @@ void Control::RemoveChildAt(Index index) { OnChildRemoved(control, index); if (host_) { + control->TraverseDescendents( + [this](Control* control) { + control->ControlHostChangeEvent_.Raise({host_, nullptr}); + }, + true); + } + + if (host_) { host_->ScheduleRelayout(); } } |
