widget: Apply theming at widget creation

This commit is contained in:
James Reed 2020-11-28 17:37:16 -07:00
parent 7952749f6f
commit f8f2a950b9
No known key found for this signature in database
GPG Key ID: 0BE2BD33C5E8125E
1 changed files with 5 additions and 10 deletions

View File

@ -3,7 +3,7 @@
--- Widget to show pending clients.
--
-- @author James Reed <jcrd@tuta.io>
-- @copyright 2019 James Reed
-- @copyright 2019-2020 James Reed
-- @module awesome-launch.widget
local awful = require("awful")
@ -18,11 +18,6 @@ local widgets = {}
local widget = {}
widget.color = beautiful.bg_focus
widget.border_color = beautiful.fg_normal
widget.width = beautiful.wibar_height or dpi(20)
widget.margins = dpi(2)
local function props_visible(s, p)
if p.screen and p.screen ~= s then
return false
@ -74,16 +69,16 @@ function widget.new(cmd, data)
min_value = 0,
max_value = data.timeout,
value = data.timeout,
color = widget.color,
border_color = widget.border_color,
color = widget.color or beautiful.bg_focus,
border_color = widget.border_color or beautiful.fg_normal,
widget = wibox.container.radialprogressbar,
},
id = "id_margin",
margins = widget.margins,
margins = widget.margins or dpi(2),
layout = wibox.container.margin,
},
id = "id_const",
width = widget.width,
width = widget.width or beautiful.wibar_height or dpi(20),
layout = wibox.container.constraint,
},
{