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:
parent
ed7c243c03
commit
a01669693e
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue