Fix wibox.layout.stack.top_only showing the bottom layer
This commit is contained in:
parent
443dda7868
commit
720469ddeb
|
@ -74,12 +74,16 @@ function stack:layout(_, width, height)
|
|||
|
||||
local h_off, v_off = spacing, spacing
|
||||
|
||||
-- Iterate backwards to draw top (index 1) last so that it appears above other layers
|
||||
for i = #self._private.widgets, 1, -1 do
|
||||
local v = self._private.widgets[i]
|
||||
if self._private.top_only then
|
||||
local v = self._private.widgets[1]
|
||||
table.insert(result, base.place_widget_at(v, h_off, v_off, width, height))
|
||||
h_off, v_off = h_off + self._private.h_offset, v_off + self._private.v_offset
|
||||
if self._private.top_only then break end
|
||||
else
|
||||
-- Iterate backwards to draw top (index 1) last so that it appears above other layers
|
||||
for i = #self._private.widgets, 1, -1 do
|
||||
local v = self._private.widgets[i]
|
||||
table.insert(result, base.place_widget_at(v, h_off, v_off, width, height))
|
||||
h_off, v_off = h_off + self._private.h_offset, v_off + self._private.v_offset
|
||||
end
|
||||
end
|
||||
|
||||
return result
|
||||
|
|
Loading…
Reference in New Issue