awful.menu: fix icon widget if no image given
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
2893d91bbf
commit
950e9f96c5
|
@ -109,13 +109,17 @@ local function add_item(data, num, item_info)
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Create the item icon widget
|
-- Create the item icon widget
|
||||||
local icon = widget({ type = "imagebox", align = "left" })
|
local icon
|
||||||
if item_info[3] then
|
if item_info[3] then
|
||||||
|
icon = widget({ type = "imagebox", align = "left" })
|
||||||
if type(item_info[3]) == "string" then
|
if type(item_info[3]) == "string" then
|
||||||
icon.image = image(item_info[3])
|
icon.image = image(item_info[3])
|
||||||
else
|
else
|
||||||
icon.image = item_info[3]
|
icon.image = item_info[3]
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
icon = widget({type = "textbox", align = "left" })
|
||||||
|
icon.width = data.h
|
||||||
end
|
end
|
||||||
|
|
||||||
icon:buttons(bindings)
|
icon:buttons(bindings)
|
||||||
|
|
Loading…
Reference in New Issue