Merge pull request #91 from Ram-Z/icon_only
widget/taglist: don't add margin when icon_only = true
This commit is contained in:
commit
e30935c934
|
@ -76,8 +76,12 @@ function common.list_update(w, buttons, label, data, objects)
|
||||||
|
|
||||||
local text, bg, bg_image, icon = label(o)
|
local text, bg, bg_image, icon = label(o)
|
||||||
-- The text might be invalid, so use pcall
|
-- The text might be invalid, so use pcall
|
||||||
if not pcall(tb.set_markup, tb, text) then
|
if text == nil or text == "" then
|
||||||
tb:set_markup("<i><Invalid text></i>")
|
m:set_margins(0)
|
||||||
|
else
|
||||||
|
if not pcall(tb.set_markup, tb, text) then
|
||||||
|
tb:set_markup("<i><Invalid text></i>")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
bgb:set_bg(bg)
|
bgb:set_bg(bg)
|
||||||
if type(bg_image) == "function" then
|
if type(bg_image) == "function" then
|
||||||
|
|
|
@ -43,7 +43,7 @@ function taglist.taglist_label(t, args)
|
||||||
local taglist_squares_resize = theme.taglist_squares_resize or args.squares_resize or "true"
|
local taglist_squares_resize = theme.taglist_squares_resize or args.squares_resize or "true"
|
||||||
local taglist_disable_icon = args.taglist_disable_icon or theme.taglist_disable_icon or false
|
local taglist_disable_icon = args.taglist_disable_icon or theme.taglist_disable_icon or false
|
||||||
local font = args.font or theme.taglist_font or theme.font or ""
|
local font = args.font or theme.taglist_font or theme.font or ""
|
||||||
local text = "<span font_desc='"..font.."'>"
|
local text = nil
|
||||||
local sel = capi.client.focus
|
local sel = capi.client.focus
|
||||||
local bg_color = nil
|
local bg_color = nil
|
||||||
local fg_color = nil
|
local fg_color = nil
|
||||||
|
@ -98,14 +98,15 @@ function taglist.taglist_label(t, args)
|
||||||
fg_color = fg_focus
|
fg_color = fg_focus
|
||||||
end
|
end
|
||||||
if not tag.getproperty(t, "icon_only") then
|
if not tag.getproperty(t, "icon_only") then
|
||||||
|
text = "<span font_desc='"..font.."'>"
|
||||||
if fg_color then
|
if fg_color then
|
||||||
text = text .. "<span color='"..util.color_strip_alpha(fg_color).."'>" ..
|
text = text .. "<span color='"..util.color_strip_alpha(fg_color).."'>" ..
|
||||||
(util.escape(t.name) or "") .. "</span>"
|
(util.escape(t.name) or "") .. "</span>"
|
||||||
else
|
else
|
||||||
text = text .. (util.escape(t.name) or "")
|
text = text .. (util.escape(t.name) or "")
|
||||||
end
|
end
|
||||||
|
text = text .. "</span>"
|
||||||
end
|
end
|
||||||
text = text .. "</span>"
|
|
||||||
if not taglist_disable_icon then
|
if not taglist_disable_icon then
|
||||||
if tag.geticon(t) and type(tag.geticon(t)) == "image" then
|
if tag.geticon(t) and type(tag.geticon(t)) == "image" then
|
||||||
icon = tag.geticon(t)
|
icon = tag.geticon(t)
|
||||||
|
|
Loading…
Reference in New Issue