tests: Test progressbat paddings, margins and clip

This commit is contained in:
Emmanuel Lepage Vallee 2016-07-24 22:18:12 -04:00
parent a8568eb969
commit 7b11f1c1b4
2 changed files with 35 additions and 0 deletions

View File

@ -77,6 +77,8 @@ local progressbar = { mt = {} }
--- Force the inner part (the bar) to fit in the background shape.
--
--@DOC_wibox_widget_progressbar_clip_EXAMPLE@
--
-- @property clip
-- @tparam[opt=true] boolean clip
@ -129,6 +131,9 @@ local progressbar = { mt = {} }
--- The progressbar margins.
-- Note that if the `clip` is disabled, this allows the background to be smaller
-- than the bar.
--
-- See the `clip` example.
--
-- @tparam[opt=0] (table|number|nil) margins A table for each side or a number
-- @tparam[opt=0] number margins.top
-- @tparam[opt=0] number margins.bottom
@ -140,6 +145,9 @@ local progressbar = { mt = {} }
--- The progressbar padding.
-- Note that if the `clip` is disabled, this allows the bar to be taller
-- than the background.
--
-- See the `clip` example.
--
-- @tparam[opt=0] (table|number|nil) padding A table for each side or a number
-- @tparam[opt=0] number padding.top
-- @tparam[opt=0] number padding.bottom

View File

@ -0,0 +1,27 @@
local parent = ... --DOC_HIDE
local wibox = require("wibox") --DOC_HIDE
local gears = {shape = require("gears.shape") } --DOC_HIDE
local beautiful = require("beautiful") --DOC_HIDE
parent:add( --DOC_HIDE
wibox.widget {
value = 75,
max_value = 100,
border_width = 2,
border_color = beautiful.border_color,
color = beautiful.border_color,
shape = gears.shape.rounded_bar,
bar_shape = gears.shape.rounded_bar,
clip = false,
forced_height = 30,
forced_width = 100,
paddings = 5,
margins = {
top = 12,
bottom = 12,
},
widget = wibox.widget.progressbar,
}
) --DOC_HIDE