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

@ -131,6 +131,8 @@ public:
virtual void save_to(AK::JsonObject&) override;
void schedule_relayout();
protected:
GWindow(CObject* parent = nullptr);
virtual void wm_event(GWMEvent&);
@ -175,4 +177,5 @@ private:
String m_entered_keybind;
int m_max_keybind_length { 0 };
HashMap<String, WeakPtr<GWidget>> m_keyboard_activation_targets;
bool m_layout_pending { false };
};