awful.menu: Handle invalid images better
This fixes problem where e.g. loading an image fails and thus the displayed layout gets messed up. Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
parent
01e6e2a07b
commit
07164aa995
|
@ -237,9 +237,13 @@ local function add_item(data, num, item_info)
|
|||
icon = img
|
||||
end
|
||||
iconbox = wibox.widget.imagebox()
|
||||
iconbox:set_image(icon)
|
||||
margin:set_left(2)
|
||||
else
|
||||
if not iconbox:set_image(icon) then
|
||||
-- Setting the image failed, it must be invalid
|
||||
iconbox = nil
|
||||
end
|
||||
end
|
||||
if not iconbox then
|
||||
margin:set_left(data.h + 2)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue