瀏覽代碼

LibGUI: Don't ignore invisible widgets during layout changes

As they may be setting themselves visible again in the process.
Fixes inability to toggle widgets on and off in some apps.
thankyouverycool 3 年之前
父節點
當前提交
1d81d2e072
共有 1 個文件被更改,包括 4 次插入6 次删除
  1. 4 6
      Userland/Libraries/LibGUI/Widget.cpp

+ 4 - 6
Userland/Libraries/LibGUI/Widget.cpp

@@ -201,12 +201,10 @@ Widget::~Widget() = default;
 
 
 void Widget::layout_relevant_change_occured()
 void Widget::layout_relevant_change_occured()
 {
 {
-    if (is_visible()) {
-        if (auto* parent = parent_widget())
-            parent->layout_relevant_change_occured();
-        else if (window())
-            window()->schedule_relayout();
-    }
+    if (auto* parent = parent_widget())
+        parent->layout_relevant_change_occured();
+    else if (window())
+        window()->schedule_relayout();
 }
 }
 
 
 void Widget::child_event(Core::ChildEvent& event)
 void Widget::child_event(Core::ChildEvent& event)