mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 14:19:48 +00:00
LibGUI: Avoid some unneeded relayouts from layout relevant changes
This commit is contained in:
parent
80ea141ffe
commit
a0938d62f3
Notes:
sideshowbarker
2024-07-17 09:44:28 +09:00
Author: https://github.com/frhun
Commit: a0938d62f3
Pull-request: https://github.com/SerenityOS/serenity/pull/14478
Issue: https://github.com/SerenityOS/serenity/issues/14420
1 changed files with 6 additions and 4 deletions
|
@ -201,10 +201,12 @@ Widget::~Widget() = default;
|
|||
|
||||
void Widget::layout_relevant_change_occured()
|
||||
{
|
||||
if (auto* parent = parent_widget())
|
||||
parent->layout_relevant_change_occured();
|
||||
else
|
||||
invalidate_layout();
|
||||
if (is_visible()) {
|
||||
if (auto* parent = parent_widget())
|
||||
parent->layout_relevant_change_occured();
|
||||
else if (window())
|
||||
window()->schedule_relayout();
|
||||
}
|
||||
}
|
||||
|
||||
void Widget::child_event(Core::ChildEvent& event)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue