mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
awful.widget.layoutbox: use attached_add_signal
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
121a229492
commit
d7a961175f
1 changed files with 3 additions and 12 deletions
|
@ -8,6 +8,7 @@ local setmetatable = setmetatable
|
|||
local ipairs = ipairs
|
||||
local button = require("awful.button")
|
||||
local layout = require("awful.layout")
|
||||
local tag = require("awful.tag")
|
||||
local beautiful = require("beautiful")
|
||||
local capi = { image = image,
|
||||
screen = screen,
|
||||
|
@ -41,19 +42,9 @@ function new(screen, args)
|
|||
return update(w, tag.screen)
|
||||
end
|
||||
|
||||
capi.screen[screen]:add_signal("tag::attach", function(s, tag)
|
||||
tag:add_signal("property::selected", update_on_tag_selection)
|
||||
tag:add_signal("property::layout", update_on_tag_selection)
|
||||
end)
|
||||
capi.screen[screen]:add_signal("tag::detach", function(s, tag)
|
||||
tag:remove_signal("property::selected", update_on_tag_selection)
|
||||
tag:remove_signal("property::layout", update_on_tag_selection)
|
||||
end)
|
||||
tag.attached_add_signal(screen, "property::selected", update_on_tag_selection)
|
||||
tag.attached_add_signal(screen, "property::layout", update_on_tag_selection)
|
||||
|
||||
for _, tag in ipairs(capi.screen[screen]:tags()) do
|
||||
tag:add_signal("property::selected", update_on_tag_selection)
|
||||
tag:add_signal("property::layout", update_on_tag_selection)
|
||||
end
|
||||
return w
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue