aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/Control.cpp
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-12-06 20:06:10 +0800
committerYuqian Yang <crupest@crupest.life>2025-12-07 19:52:05 +0800
commit4a30bf58a48ed6f31f4c53473e8de70a8cd819da (patch)
tree32aab619013cbe2d0557a212832ba24833d2cc36 /src/ui/controls/Control.cpp
parent9a87e5cf786f3e8fddc933136d210edd4ef72c89 (diff)
downloadcru-4a30bf58a48ed6f31f4c53473e8de70a8cd819da.tar.gz
cru-4a30bf58a48ed6f31f4c53473e8de70a8cd819da.tar.bz2
cru-4a30bf58a48ed6f31f4c53473e8de70a8cd819da.zip
Fix SDL popup window.
Diffstat (limited to 'src/ui/controls/Control.cpp')
-rw-r--r--src/ui/controls/Control.cpp16
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();
}
}