awful.menu: align text when item doesn't have icon
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
f58c878b96
commit
4a6885e0eb
|
@ -116,12 +116,16 @@ local function add_item(data, num, item_info)
|
||||||
if item_info[3] then
|
if item_info[3] then
|
||||||
icon = widget({ type = "imagebox", name = "icon", align = "left" })
|
icon = widget({ type = "imagebox", name = "icon", align = "left" })
|
||||||
icon.image = image(item_info[3])
|
icon.image = image(item_info[3])
|
||||||
icon:buttons(bindings)
|
else
|
||||||
|
icon = widget({ type = "textbox", name = "icon", align = "left" })
|
||||||
function icon.mouse_enter() mouse_enter(item) end
|
icon.width = theme.menu_height
|
||||||
function icon.mouse_leave() mouse_leave(item) end
|
|
||||||
end
|
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
|
-- Create the item label widget
|
||||||
local label = widget({
|
local label = widget({
|
||||||
type = "textbox",
|
type = "textbox",
|
||||||
|
|
Loading…
Reference in New Issue