widget: Use module-level widget options directly
This commit is contained in:
parent
63e552f0e3
commit
aeba062c06
17
widget.lua
17
widget.lua
|
@ -66,15 +66,6 @@ function widget.update_widgets()
|
||||||
end
|
end
|
||||||
|
|
||||||
function widget.new(cmd, data)
|
function widget.new(cmd, data)
|
||||||
local defaults = {
|
|
||||||
color = beautiful.bg_focus,
|
|
||||||
border_color = beautiful.fg_normal,
|
|
||||||
width = 20,
|
|
||||||
margins = 2,
|
|
||||||
}
|
|
||||||
|
|
||||||
gears.table.crush(defaults, widget)
|
|
||||||
|
|
||||||
return wibox.widget {
|
return wibox.widget {
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
@ -83,16 +74,16 @@ function widget.new(cmd, data)
|
||||||
min_value = 0,
|
min_value = 0,
|
||||||
max_value = data.timeout,
|
max_value = data.timeout,
|
||||||
value = data.timeout,
|
value = data.timeout,
|
||||||
color = defaults.color,
|
color = widget.color,
|
||||||
border_color = defaults.border_color,
|
border_color = widget.border_color,
|
||||||
widget = wibox.container.radialprogressbar,
|
widget = wibox.container.radialprogressbar,
|
||||||
},
|
},
|
||||||
id = "id_margin",
|
id = "id_margin",
|
||||||
margins = defaults.margins,
|
margins = widget.margins,
|
||||||
layout = wibox.container.margin,
|
layout = wibox.container.margin,
|
||||||
},
|
},
|
||||||
id = "id_const",
|
id = "id_const",
|
||||||
width = defaults.width,
|
width = widget.width,
|
||||||
layout = wibox.container.constraint,
|
layout = wibox.container.constraint,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue