awful.menu: fix auto_expand

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2009-02-23 14:12:28 +01:00
parent 67f04c0d68
commit 37d2fb6781
1 changed files with 7 additions and 1 deletions

View File

@ -268,7 +268,13 @@ function new(menu, parent, num)
data.theme = parent and parent.theme or load_theme(menu)
data.parent = parent
data.child = {}
data.auto_expand = parent and parent.auto_expand or menu.auto_expand or true
if parent and parent.auto_expand then
data.auto_expand = true
elseif menu.auto_expand ~= nil then
data.auto_expand = menu.auto_expand
else
data.auto_expand = true
end
data.h = parent and parent.h or data.theme.menu_height
data.w = parent and parent.w or data.theme.menu_width