awful.widget.taglist: use attached_add_signal
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
c66be3aa82
commit
1692496fce
|
@ -66,23 +66,15 @@ function new(screen, label, buttons)
|
|||
local uc = function (c) return u(c.screen) end
|
||||
capi.client.add_signal("focus", uc)
|
||||
capi.client.add_signal("unfocus", uc)
|
||||
tag.attached_add_signal(screen, "property::selected", uc)
|
||||
tag.attached_add_signal(screen, "property::icon", uc)
|
||||
tag.attached_add_signal(screen, "property::hide", uc)
|
||||
capi.screen[screen]:add_signal("tag::attach", function(screen, tag)
|
||||
taglist_update(s, w, label, buttons, data, widgets)
|
||||
tag:add_signal("property::selected", uc)
|
||||
tag:add_signal("property::icon", uc)
|
||||
tag:add_signal("property::hide", uc)
|
||||
u(screen.index)
|
||||
end)
|
||||
capi.screen[screen]:add_signal("tag::detach", function(screen, tag)
|
||||
taglist_update(s, w, label, buttons, data, widgets)
|
||||
tag:remove_signal("property::selected", uc)
|
||||
tag:remove_signal("property::icon", uc)
|
||||
tag:remove_signal("property::hide", uc)
|
||||
u(screen.index)
|
||||
end)
|
||||
for _, tag in ipairs(capi.screen[screen]:tags()) do
|
||||
tag:add_signal("property::selected", uc)
|
||||
tag:add_signal("property::icon", uc)
|
||||
tag:add_signal("property::hide", uc)
|
||||
end
|
||||
capi.client.add_signal("new", function(c)
|
||||
c:add_signal("property::urgent", uc)
|
||||
c:add_signal("property::screen", function(c)
|
||||
|
|
Loading…
Reference in New Issue