tasklist: Use awful.widget.clienticon by default.

This allows sharper icons to be used.

Fixes #2143
This commit is contained in:
Emmanuel Lepage Vallee 2019-03-06 23:16:34 -05:00
parent a081413339
commit 5c57f43643
1 changed files with 33 additions and 1 deletions

View File

@ -87,7 +87,13 @@ local timer = require("gears.timer")
local gcolor = require("gears.color") local gcolor = require("gears.color")
local gstring = require("gears.string") local gstring = require("gears.string")
local gdebug = require("gears.debug") local gdebug = require("gears.debug")
local dpi = require("beautiful").xresources.apply_dpi
local base = require("wibox.widget.base") local base = require("wibox.widget.base")
local wfixed = require("wibox.layout.fixed")
local wmargin = require("wibox.container.margin")
local wtextbox = require("wibox.widget.textbox")
local clienticon = require("awful.widget.clienticon")
local wbackground = require("wibox.container.background")
local function get_screen(s) local function get_screen(s)
return s and screen[s] return s and screen[s]
@ -247,6 +253,32 @@ local instances
-- Public structures -- Public structures
tasklist.filter, tasklist.source = {}, {} tasklist.filter, tasklist.source = {}, {}
-- This is the same template as awful.widget.common, but with an clienticon widget
local default_template = {
{
{
clienticon,
id = "icon_margin_role",
left = dpi(4),
widget = wmargin
},
{
{
id = "text_role",
widget = wtextbox,
},
id = "text_margin_role",
left = dpi(4),
right = dpi(4),
widget = wmargin
},
fill_space = true,
layout = wfixed.horizontal
},
id = "background_role",
widget = wbackground
}
local function tasklist_label(c, args, tb) local function tasklist_label(c, args, tb)
if not args then args = {} end if not args then args = {} end
local theme = beautiful.get() local theme = beautiful.get()
@ -423,7 +455,7 @@ local function tasklist_update(s, w, buttons, filter, data, style, update_functi
local function label(c, tb) return tasklist_label(c, style, tb) end local function label(c, tb) return tasklist_label(c, style, tb) end
update_function(w, buttons, label, data, clients, { update_function(w, buttons, label, data, clients, {
widget_template = args.widget_template, widget_template = args.widget_template or default_template,
create_callback = create_callback, create_callback = create_callback,
}) })
end end