mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-29 07:48:47 +00:00
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:
parent
d0799f3648
commit
98a6149b4f
Notes:
sideshowbarker
2024-07-19 11:32:20 +09:00
Author: https://github.com/awesomekling
Commit: 98a6149b4f
4 changed files with 24 additions and 14 deletions
|
@ -736,3 +736,16 @@ void GWindow::set_fullscreen(bool fullscreen)
|
|||
request.value = fullscreen;
|
||||
GWindowServerConnection::the().sync_request(request, WSAPI_ServerMessage::Type::DidSetFullscreen);
|
||||
}
|
||||
|
||||
void GWindow::schedule_relayout()
|
||||
{
|
||||
if (m_layout_pending)
|
||||
return;
|
||||
m_layout_pending = true;
|
||||
deferred_invoke([this](auto&) {
|
||||
if (main_widget())
|
||||
main_widget()->do_layout();
|
||||
update();
|
||||
m_layout_pending = false;
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue