awful.menu: resize menu when item count changes

When the number of items of a menu change by menu:add or menu:delete
and the menu is shown, its wibox has to resize.
This commit is contained in:
▟ ▖▟ ▖ 2015-04-18 08:57:15 +02:00
parent 40b4387e6d
commit fc39db377f
1 changed files with 6 additions and 0 deletions

View File

@ -422,6 +422,9 @@ function menu:add(args, index)
table.insert(self.items, item)
self.layout:add(item._background)
end
if self.wibox then
set_size(self)
end
return item
end
@ -451,6 +454,9 @@ function menu:delete(num)
end
table.remove(self.child, num)
end
if self.wibox then
set_size(self)
end
end
--------------------------------------------------------------------------------