diff options
Diffstat (limited to 'src/ui/control.cpp')
-rw-r--r-- | src/ui/control.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ui/control.cpp b/src/ui/control.cpp index 8aec8640..81cfe9b1 100644 --- a/src/ui/control.cpp +++ b/src/ui/control.cpp @@ -242,10 +242,10 @@ namespace cru { return window->GetFocusControl() == this; } - void Control::Relayout() + void Control::InvalidateLayout() { - OnMeasure(GetSize()); - OnLayout(Rect(GetPositionRelative(), GetSize())); + if (const auto window = GetWindow()) + LayoutManager::GetInstance()->InvalidateWindowLayout(window); } void Control::Measure(const Size& available_size) @@ -278,8 +278,8 @@ namespace cru { control->OnAttachToWindow(window); }); window->RefreshControlList(); + InvalidateLayout(); } - Relayout(); } void Control::OnRemoveChild(Control* child) @@ -290,8 +290,8 @@ namespace cru { control->OnDetachToWindow(window); }); window->RefreshControlList(); + InvalidateLayout(); } - Relayout(); } void Control::OnAttachToWindow(Window* window) |