tests: Test the radical progressbar

This commit is contained in:
Emmanuel Lepage Vallee 2016-07-25 00:16:37 -04:00
parent a4743ed2c2
commit 6128e995f2
6 changed files with 167 additions and 0 deletions

View File

@ -0,0 +1,25 @@
--DOC_HIDE_ALL
local wibox = require("wibox")
return {
text = "Before",
align = "center",
valign = "center",
widget = wibox.widget.textbox,
},
{
{
{
text = "After",
align = "center",
valign = "center",
widget = wibox.widget.textbox,
},
value = 0.5,
max_value = 1,
min_value = 0,
widget = wibox.container.radialprogressbar
},
margins = 5,
layout = wibox.container.margin
}

View File

@ -0,0 +1,26 @@
--DOC_HIDE_ALL
local parent = ...
local wibox = require("wibox")
local function gen(val)
return wibox.widget {
{
text = "Value: "..val,
align = "center",
valign = "center",
widget = wibox.widget.textbox,
},
border_color = val,
value = 0.75,
widget = wibox.container.radialprogressbar
}
end
local l = wibox.layout {
gen("#ff0000"),gen("#00ff00"),gen("#0000ff"),
forced_height = 30,
forced_width = 400,
layout = wibox.layout.flex.horizontal
}
parent:add(l)

View File

@ -0,0 +1,29 @@
--DOC_HIDE_ALL
local parent = ...
local wibox = require("wibox")
local function gen(val)
return wibox.widget {
{
text = "Value: "..val,
align = "center",
valign = "center",
widget = wibox.widget.textbox,
},
paddings = 0,
border_width = val,
value = 0.75,
max_value = 1,
min_value = 0,
widget = wibox.container.radialprogressbar
}
end
local l = wibox.layout {
gen(1),gen(3),gen(5),
forced_height = 30,
forced_width = 400,
layout = wibox.layout.flex.horizontal
}
parent:add(l)

View File

@ -0,0 +1,26 @@
--DOC_HIDE_ALL
local parent = ...
local wibox = require("wibox")
local function gen(val)
return wibox.widget {
{
text = "Value: "..val,
align = "center",
valign = "center",
widget = wibox.widget.textbox,
},
color = val,
value = 0.75,
widget = wibox.container.radialprogressbar
}
end
local l = wibox.layout {
gen("#ff0000"),gen("#00ff00"),gen("#0000ff"),
forced_height = 30,
forced_width = 400,
layout = wibox.layout.flex.horizontal
}
parent:add(l)

View File

@ -0,0 +1,33 @@
--DOC_HIDE_ALL
local parent = ...
local wibox = require("wibox")
local beautiful = require("beautiful")
local function gen(val)
return wibox.widget {
{
{
text = "Value: "..val,
align = "center",
valign = "center",
widget = wibox.widget.textbox,
},
bg = beautiful.bg_normal,
widget = wibox.widget.background,
},
paddings = val,
value = 0.75,
max_value = 1,
min_value = 0,
widget = wibox.container.radialprogressbar
}
end
local l = wibox.layout {
gen(0),gen(5),gen(10),
forced_height = 30,
forced_width = 400,
layout = wibox.layout.flex.horizontal
}
parent:add(l)

View File

@ -0,0 +1,28 @@
--DOC_HIDE_ALL
local parent = ...
local wibox = require("wibox")
local function gen(val)
return wibox.widget {
{
text = "Value: "..(val*100).."%",
align = "center",
valign = "center",
widget = wibox.widget.textbox,
},
padding = 5,
value = val,
max_value = 1,
min_value = 0,
widget = wibox.container.radialprogressbar
}
end
local l = wibox.layout {
gen(0.0),gen(0.3),gen(1.0),
forced_height = 30,
forced_width = 400,
layout = wibox.layout.flex.horizontal
}
parent:add(l)