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)
|
table.insert(self.items, item)
|
||||||
self.layout:add(item._background)
|
self.layout:add(item._background)
|
||||||
end
|
end
|
||||||
|
if self.wibox then
|
||||||
|
set_size(self)
|
||||||
|
end
|
||||||
return item
|
return item
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -451,6 +454,9 @@ function menu:delete(num)
|
||||||
end
|
end
|
||||||
table.remove(self.child, num)
|
table.remove(self.child, num)
|
||||||
end
|
end
|
||||||
|
if self.wibox then
|
||||||
|
set_size(self)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
--------------------------------------------------------------------------------
|
--------------------------------------------------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue