mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +00:00
LibGUI: Make the "enabled" widget state propagate to child widgets
This simplifies building composite widgets by not having to worry about updating widget subtrees.
This commit is contained in:
@@ -616,6 +616,12 @@ void Widget::set_enabled(bool enabled)
|
||||
if (m_enabled == enabled)
|
||||
return;
|
||||
m_enabled = enabled;
|
||||
|
||||
for_each_child_widget([enabled](auto& child) {
|
||||
child.set_enabled(enabled);
|
||||
return IterationDecision::Continue;
|
||||
});
|
||||
|
||||
Event e(Event::EnabledChange);
|
||||
event(e);
|
||||
update();
|
||||
|
||||
Reference in New Issue
Block a user