Merge pull request #3187 from PlayerNameHere/master
Fix wibox.layout.stack:raise() returning prematurely and inserting the widget at the end instead of the start
This commit is contained in:
commit
ed6cdf87b1
|
@ -116,11 +116,11 @@ end
|
||||||
-- @method raise
|
-- @method raise
|
||||||
-- @tparam number index the widget index to raise
|
-- @tparam number index the widget index to raise
|
||||||
function stack:raise(index)
|
function stack:raise(index)
|
||||||
if (not index) or self._private.widgets[index] then return end
|
if (not index) or (not self._private.widgets[index]) then return end
|
||||||
|
|
||||||
local w = self._private.widgets[index]
|
local w = self._private.widgets[index]
|
||||||
table.remove(self._private.widgets, index)
|
table.remove(self._private.widgets, index)
|
||||||
table.insert(self._private.widgets, w)
|
table.insert(self._private.widgets, 1, w)
|
||||||
|
|
||||||
self:emit_signal("widget::layout_changed")
|
self:emit_signal("widget::layout_changed")
|
||||||
end
|
end
|
||||||
|
@ -170,8 +170,12 @@ end
|
||||||
|
|
||||||
function stack:set_horizontal_offset(value)
|
function stack:set_horizontal_offset(value)
|
||||||
self._private.h_offset = value
|
self._private.h_offset = value
|
||||||
self:emit_signal("widget::horizontal_offset")
|
self:emit_signal("widget::layout_changed")
|
||||||
self:emit_signal("property::top_only", value)
|
self:emit_signal("property::horizontal_offset", value)
|
||||||
|
end
|
||||||
|
|
||||||
|
function stack:get_horizontal_offset()
|
||||||
|
return self._private.h_offset
|
||||||
end
|
end
|
||||||
|
|
||||||
function stack:set_vertical_offset(value)
|
function stack:set_vertical_offset(value)
|
||||||
|
@ -180,6 +184,10 @@ function stack:set_vertical_offset(value)
|
||||||
self:emit_signal("property::vertical_offset", value)
|
self:emit_signal("property::vertical_offset", value)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function stack:get_vertical_offset()
|
||||||
|
return self._private.v_offset
|
||||||
|
end
|
||||||
|
|
||||||
--- Create a new stack layout.
|
--- Create a new stack layout.
|
||||||
--
|
--
|
||||||
-- @constructorfct wibox.layout.stack
|
-- @constructorfct wibox.layout.stack
|
||||||
|
|
Loading…
Reference in New Issue