LibGUI: Call GWidget::resize_event() before doing widget layout

The widget layout system currently works by having layouts size the
children of a widgets. The children then get resize events, giving them
a chance to lay out their own children, etc.

In keeping with this, we need to handle the resize event before calling
do_layout() in a widget, since the resize event handler may do things
that end up affecting the layout, but layout should not affect the
resize event since the event comes from the widget parent, not itself.
This commit is contained in:
Andreas Kling 2019-12-30 00:26:19 +01:00
parent aaaf04f393
commit 57f55f297b
Notes: sideshowbarker 2024-07-19 10:33:11 +09:00

View File

@ -227,8 +227,8 @@ void GWidget::notify_layout_changed(Badge<GLayout>)
void GWidget::handle_resize_event(GResizeEvent& event)
{
resize_event(event);
do_layout();
return resize_event(event);
}
void GWidget::handle_mouseup_event(GMouseEvent& event)