Add external function for {tag,task,tab}list background image

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Emmanuel Lepage Vallee 2013-01-03 20:54:40 -05:00 committed by Uli Schlachter
parent 7a47355c99
commit 1c76560da7
1 changed files with 6 additions and 1 deletions

View File

@ -48,6 +48,7 @@ function common.list_update(w, buttons, label, data, objects)
ib = cache.ib ib = cache.ib
tb = cache.tb tb = cache.tb
bgb = cache.bgb bgb = cache.bgb
m = cache.m
else else
ib = wibox.widget.imagebox() ib = wibox.widget.imagebox()
tb = wibox.widget.textbox() tb = wibox.widget.textbox()
@ -68,7 +69,8 @@ function common.list_update(w, buttons, label, data, objects)
data[o] = { data[o] = {
ib = ib, ib = ib,
tb = tb, tb = tb,
bgb = bgb bgb = bgb,
m = m
} }
end end
@ -78,6 +80,9 @@ function common.list_update(w, buttons, label, data, objects)
tb:set_markup("<i>&lt;Invalid text&gt;</i>") tb:set_markup("<i>&lt;Invalid text&gt;</i>")
end end
bgb:set_bg(bg) bgb:set_bg(bg)
if type(bg_image) == "function" then
bg_image = bg_image(tb,o,m,objects,i)
end
bgb:set_bgimage(bg_image) bgb:set_bgimage(bg_image)
ib:set_image(icon) ib:set_image(icon)
w:add(bgb) w:add(bgb)