wibox.widget.base: do not call set_children if children is nil

This commit is contained in:
getzze 2017-03-31 23:56:20 +01:00 committed by Daniel Hahler
parent 0e9a0cdee9
commit 59662bc971
2 changed files with 6 additions and 4 deletions

View File

@ -112,7 +112,7 @@ looks like this:
end
widget:after_draw_children(context, cr, width, height)
The `:set_children()` method is called recursively when setting a widget with
The `:set_children()` method gets called recursively when setting a widget with
the declarative layout system, therefore the method should be well defined.
It should probably hook to the `:add` or `:add_widget` methods or be overridden
to do nothing.
It should probably hook into the `:add` or `:add_widget` methods or be
overridden to do nothing.

View File

@ -504,7 +504,9 @@ local function drill(ids, content)
end
end
-- Replace all children (if any) with the new ones.
if widgets then
l:set_children(widgets)
end
return l, id
end