是否可以在很棒的 wm 中将小部件绘制在其他小部件的上方?例如:在进度条上绘制带有一些文本(百分比)的 texbox。
这是有效的解决方案
local function make_stack(w1, w2)
local ret = wibox.widget.base.make_widget()
ret.fit = function(self, ...) return w1:fit(...) end
ret.draw = function(self, wibox, cr, width, height)
w1:draw(wibox, cr, width, height)
w2:draw(wibox, cr, width, height)
end
update = function() ret:emit_signal("widget::updated") end
w1:connect_signal("widget::updated", update)
w2:connect_signal("widget::updated", update)
return ret
end