awful.widget: check for image
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
83eadb46cb
commit
2c71245388
|
@ -357,7 +357,7 @@ end
|
||||||
-- @param args Standard widget table arguments, plus image for the image path.
|
-- @param args Standard widget table arguments, plus image for the image path.
|
||||||
-- @return A textbox widget configured as a button.
|
-- @return A textbox widget configured as a button.
|
||||||
function button(args)
|
function button(args)
|
||||||
if not args then return end
|
if not args or not args.image then return end
|
||||||
args.type = "textbox"
|
args.type = "textbox"
|
||||||
local w = capi.widget(args)
|
local w = capi.widget(args)
|
||||||
local img_release = "<bg image=\"" .. args.image .. "\" resize=\"true\"/>"
|
local img_release = "<bg image=\"" .. args.image .. "\" resize=\"true\"/>"
|
||||||
|
@ -376,6 +376,7 @@ end
|
||||||
function launcher(args)
|
function launcher(args)
|
||||||
if not args.command and not args.menu then return end
|
if not args.command and not args.menu then return end
|
||||||
local w = button(args)
|
local w = button(args)
|
||||||
|
if not w then return end
|
||||||
local b = w:buttons()
|
local b = w:buttons()
|
||||||
|
|
||||||
if args.command then
|
if args.command then
|
||||||
|
|
Loading…
Reference in New Issue