From 4a6885e0eb4a48b33da14ad303a630d8bb461051 Mon Sep 17 00:00:00 2001 From: Damien Leone Date: Wed, 22 Oct 2008 16:20:32 +0200 Subject: [PATCH] awful.menu: align text when item doesn't have icon Signed-off-by: Julien Danjou --- lib/awful/menu.lua.in | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/awful/menu.lua.in b/lib/awful/menu.lua.in index 52d69f41..2aac84c5 100644 --- a/lib/awful/menu.lua.in +++ b/lib/awful/menu.lua.in @@ -116,12 +116,16 @@ local function add_item(data, num, item_info) if item_info[3] then icon = widget({ type = "imagebox", name = "icon", align = "left" }) icon.image = image(item_info[3]) - icon:buttons(bindings) - - function icon.mouse_enter() mouse_enter(item) end - function icon.mouse_leave() mouse_leave(item) end + else + icon = widget({ type = "textbox", name = "icon", align = "left" }) + icon.width = theme.menu_height end + icon:buttons(bindings) + + function icon.mouse_enter() mouse_enter(item) end + function icon.mouse_leave() mouse_leave(item) end + -- Create the item label widget local label = widget({ type = "textbox",