layout.manual: Implement the `:insert()` method. (#2557)

It was documented but not implemented. It is necessary when the
"Z index" needs to be manually specified.
This commit is contained in:
Aire-One 2019-01-09 06:31:14 +01:00 committed by Emmanuel Lepage Vallée
parent ed7c243c03
commit a01669693e
1 changed files with 10 additions and 0 deletions

View File

@ -33,6 +33,16 @@ local manual_layout = {}
-- @treturn boolean If the operation is successful -- @treturn boolean If the operation is successful
-- @name insert -- @name insert
-- @class function -- @class function
function manual_layout:insert(index, widget)
table.insert(self._private.widgets, index, widget)
-- Add the point
if widget.point then
table.insert(self._private.pos, index, widget.point)
end
self:emit_signal("widget::layout_changed")
end
--- Remove one or more widgets from the layout --- Remove one or more widgets from the layout
-- The last parameter can be a boolean, forcing a recursive seach of the -- The last parameter can be a boolean, forcing a recursive seach of the