LibGUI: Make GWindow drive relayout and do it recursively

Instead of only doing a relayout in the widget you're invalidating,
we now do a recursive top-down relayout so everything gets updated.

This fixes invalid results after updating a preferred size in some
situations with nested layouts.
This commit is contained in:
Andreas Kling 2019-10-26 12:27:01 +02:00
parent d0799f3648
commit 98a6149b4f
Notes: sideshowbarker 2024-07-19 11:32:20 +09:00
4 changed files with 24 additions and 14 deletions

View file

@ -201,6 +201,8 @@ public:
virtual void save_to(AK::JsonObject&) override;
void do_layout();
protected:
explicit GWidget(GWidget* parent = nullptr);
@ -234,7 +236,6 @@ private:
void handle_mouseup_event(GMouseEvent&);
void handle_enter_event(CEvent&);
void handle_leave_event(CEvent&);
void do_layout();
void focus_previous_widget();
void focus_next_widget();