Add ability to disable tasklist icons and restore ability to set bg_images

Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Emmanuel Lepage Vallee 2013-01-03 21:00:33 -05:00 committed by Uli Schlachter
parent 1c76560da7
commit e920c74fd9
1 changed files with 11 additions and 1 deletions

View File

@ -35,10 +35,16 @@ local function tasklist_label(c, args)
local bg_urgent = args.bg_urgent or theme.tasklist_bg_urgent or theme.bg_urgent local bg_urgent = args.bg_urgent or theme.tasklist_bg_urgent or theme.bg_urgent
local fg_minimize = args.fg_minimize or theme.tasklist_fg_minimize or theme.fg_minimize local fg_minimize = args.fg_minimize or theme.tasklist_fg_minimize or theme.fg_minimize
local bg_minimize = args.bg_minimize or theme.tasklist_bg_minimize or theme.bg_minimize local bg_minimize = args.bg_minimize or theme.tasklist_bg_minimize or theme.bg_minimize
local bg_image_normal = args.bg_image_normal or theme.bg_image_normal
local bg_image_focus = args.bg_image_focus or theme.bg_image_focus
local bg_image_urgent = args.bg_image_urgent or theme.bg_image_urgent
local bg_image_minimize = args.bg_image_minimize or theme.bg_image_minimize
local tasklist_disable_icon = args.tasklist_disable_icon or theme.tasklist_disable_icon or false
local font = args.font or theme.tasklist_font or theme.font or "" local font = args.font or theme.tasklist_font or theme.font or ""
local bg = nil local bg = nil
local text = "<span font_desc='"..font.."'>" local text = "<span font_desc='"..font.."'>"
local name = "" local name = ""
local bg_image = nil
-- symbol to use to indicate certain client properties -- symbol to use to indicate certain client properties
local sticky = args.sticky or theme.tasklist_sticky or "" local sticky = args.sticky or theme.tasklist_sticky or ""
@ -62,6 +68,7 @@ local function tasklist_label(c, args)
end end
if capi.client.focus == c then if capi.client.focus == c then
bg = bg_focus bg = bg_focus
bg_image = bg_image_focus
if fg_focus then if fg_focus then
text = text .. "<span color='"..util.color_strip_alpha(fg_focus).."'>"..name.."</span>" text = text .. "<span color='"..util.color_strip_alpha(fg_focus).."'>"..name.."</span>"
else else
@ -70,15 +77,18 @@ local function tasklist_label(c, args)
elseif c.urgent and fg_urgent then elseif c.urgent and fg_urgent then
bg = bg_urgent bg = bg_urgent
text = text .. "<span color='"..util.color_strip_alpha(fg_urgent).."'>"..name.."</span>" text = text .. "<span color='"..util.color_strip_alpha(fg_urgent).."'>"..name.."</span>"
bg_image = bg_image_urgent
elseif c.minimized and fg_minimize and bg_minimize then elseif c.minimized and fg_minimize and bg_minimize then
bg = bg_minimize bg = bg_minimize
text = text .. "<span color='"..util.color_strip_alpha(fg_minimize).."'>"..name.."</span>" text = text .. "<span color='"..util.color_strip_alpha(fg_minimize).."'>"..name.."</span>"
bg_image = bg_image_minimize
else else
bg = bg_normal bg = bg_normal
text = text .. "<span color='"..util.color_strip_alpha(fg_normal).."'>"..name.."</span>" text = text .. "<span color='"..util.color_strip_alpha(fg_normal).."'>"..name.."</span>"
bg_image = bg_image_normal
end end
text = text .. "</span>" text = text .. "</span>"
return text, bg, nil, c.icon return text, bg, bg_image, not tasklist_disable_icon and c.icon or nil
end end
local function tasklist_update(s, w, buttons, filter, data, style, update_function) local function tasklist_update(s, w, buttons, filter, data, style, update_function)