From dd69936bed8037f6dae9edf5a82e84515dd0d39b Mon Sep 17 00:00:00 2001 From: Aire-One Date: Thu, 3 Oct 2019 17:42:16 +0200 Subject: [PATCH] Add a `gen_vertical_space` function to keep spacing from missalignment. --- tests/examples/sequences/template.lua | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/examples/sequences/template.lua b/tests/examples/sequences/template.lua index 426d13c49..990f01e7b 100644 --- a/tests/examples/sequences/template.lua +++ b/tests/examples/sequences/template.lua @@ -368,6 +368,14 @@ local function wrap_timeline(w, dot) } end +local function gen_vertical_space(spacing) + return wibox.widget { + draw = function() end, + fit = function() return 1, spacing end, + widget = wibox.widget.base.make_widget() + } +end + local function gen_label(text) return wibox.widget { gen_vertical_line { @@ -663,6 +671,7 @@ local function gen_timeline(args) for _, event in ipairs(history) do local ret = event.callback() if event.event == "event" then + l:add(wrap_timeline(gen_vertical_space(5))) l:add(wrap_timeline(wibox.widget { markup = ""..event.description.."", widget = wibox.widget.textbox @@ -675,11 +684,7 @@ local function gen_timeline(args) end -- Spacing. - l:add(wrap_timeline( wibox.widget { - draw = function() end, - fit = function() return 1, 10 end, - widget = wibox.widget.base.make_widget() - })) + l:add(wrap_timeline(gen_vertical_space(10))) l:add(gen_label("End"))