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:
parent
40b4387e6d
commit
fc39db377f
|
@ -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
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue