Background widget now working

This commit is contained in:
Thomas Forgione 2018-09-14 15:06:13 +02:00
parent 04a8ef5876
commit 95b91a57f7
No known key found for this signature in database
GPG Key ID: 203DAEA747F48F41
1 changed files with 11 additions and 6 deletions

View File

@ -15,10 +15,10 @@ end
function todo_list_widget(todo, s)
local text = '\n <b>' .. todo.title .. '</b>\n'
local text = '\n <b>' .. todo.title .. '</b> \n'
for key, item in pairs(todo.items) do
text = text .. ' - ' .. item .. '\n'
text = text .. ' - ' .. item .. ' \n'
end
local text = wibox.widget {
@ -35,8 +35,6 @@ function todo_list_widget(todo, s)
widget.shape_border_width = 1
widget.shape_border_color = "#ffffff"
widget.forced_width = todo.width
widget.forced_height = todo.height
widget.point = { x = todo.x, y = todo.y }
return widget
@ -54,10 +52,17 @@ function add_background_widget(s)
todo = json.parse(content)
local margin = 25
local l = wibox.layout {
layout = wibox.layout.manual
homogeneous = true,
spacing = margin,
forced_num_cols = 3,
layout = wibox.layout.grid,
}
l:set_orientation('horizontal')
local widgets = {}
for key, val in pairs(todo) do
@ -71,7 +76,7 @@ function add_background_widget(s)
})
background_widget:setup {
l,
wibox.container.margin(l, margin, margin, margin, margin),
layout = wibox.layout.manual
}