【发布时间】:2016-10-17 23:17:59
【问题描述】:
在很棒的 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
【问题讨论】:
标签: lua awesome-wm