tests: Test the arc chart container.
This commit is contained in:
parent
525a76018f
commit
de3a8bb5fb
|
@ -0,0 +1,38 @@
|
|||
--DOC_HIDE_ALL
|
||||
local parent = ...
|
||||
local wibox = require( "wibox" )
|
||||
local beautiful = require( "beautiful" )
|
||||
|
||||
local l = wibox.layout.fixed.horizontal()
|
||||
l.spacing = 10
|
||||
parent:add(l)
|
||||
|
||||
for _, v in ipairs {"", "#00ff00", "#0000ff"} do
|
||||
l:add(wibox.widget {
|
||||
{
|
||||
text = v~="" and v or "nil",
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
colors = {
|
||||
beautiful.bg_normal,
|
||||
beautiful.bg_highlight,
|
||||
beautiful.border_color,
|
||||
},
|
||||
values = {
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
},
|
||||
max_value = 10,
|
||||
min_value = 0,
|
||||
rounded_edge = false,
|
||||
bg = v~="" and v or nil,
|
||||
border_width = 0.5,
|
||||
border_color = "#000000",
|
||||
widget = wibox.container.arcchart
|
||||
})
|
||||
end
|
||||
|
||||
return nil, 60
|
|
@ -0,0 +1,48 @@
|
|||
--DOC_HIDE_ALL
|
||||
local parent = ...
|
||||
local wibox = require( "wibox" )
|
||||
local beautiful = require( "beautiful" )
|
||||
|
||||
local cols = {"#ff000022","#00ff0022","#0000ff22","#ff00ff22"}
|
||||
|
||||
local l = wibox.layout.fixed.horizontal()
|
||||
l.spacing = 10
|
||||
parent:add(l)
|
||||
|
||||
for _, v in ipairs {0,1,3,6.5} do
|
||||
l:add(wibox.widget {
|
||||
{
|
||||
{
|
||||
{
|
||||
text = v,
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
bg= "#ff000044",
|
||||
widget = wibox.container.background,
|
||||
},
|
||||
colors = {
|
||||
beautiful.bg_normal,
|
||||
beautiful.bg_highlight,
|
||||
beautiful.border_color,
|
||||
},
|
||||
values = {
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
},
|
||||
max_value = 10,
|
||||
min_value = 0,
|
||||
rounded_edge = false,
|
||||
bg = "#00ff0033",
|
||||
border_width = v,
|
||||
border_color = "#000000",
|
||||
widget = wibox.container.arcchart
|
||||
},
|
||||
bg = cols[_],
|
||||
widget = wibox.container.background
|
||||
})
|
||||
end
|
||||
|
||||
return nil, 60
|
|
@ -0,0 +1,79 @@
|
|||
--DOC_HIDE_ALL
|
||||
local parent = ...
|
||||
local wibox = require( "wibox" )
|
||||
local beautiful = require( "beautiful" )
|
||||
|
||||
local l = wibox.layout.fixed.horizontal()
|
||||
l.spacing = 10
|
||||
parent:add(l)
|
||||
|
||||
for _, v in ipairs {0, 2, 4} do
|
||||
l:add(wibox.widget {
|
||||
{
|
||||
{
|
||||
text = v,
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
bg= beautiful.bg_normal,
|
||||
widget = wibox.container.background,
|
||||
},
|
||||
colors = {
|
||||
beautiful.bg_normal,
|
||||
beautiful.bg_highlight,
|
||||
beautiful.border_color,
|
||||
},
|
||||
values = {
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
},
|
||||
max_value = 10,
|
||||
min_value = 0,
|
||||
rounded_edge = false,
|
||||
bg = "#ff000033",
|
||||
border_width = 0.5,
|
||||
border_color = "#000000",
|
||||
paddings = v,
|
||||
widget = wibox.container.arcchart
|
||||
})
|
||||
end
|
||||
|
||||
l:add(wibox.widget {
|
||||
{
|
||||
{
|
||||
text = 6,
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
bg= beautiful.bg_normal,
|
||||
widget = wibox.container.background,
|
||||
},
|
||||
colors = {
|
||||
beautiful.bg_normal,
|
||||
beautiful.bg_highlight,
|
||||
beautiful.border_color,
|
||||
},
|
||||
values = {
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
},
|
||||
max_value = 10,
|
||||
min_value = 0,
|
||||
rounded_edge = false,
|
||||
bg = "#ff000033",
|
||||
border_width = 0.5,
|
||||
border_color = "#000000",
|
||||
paddings = {
|
||||
left = 6,
|
||||
right = 6,
|
||||
top = 6,
|
||||
bottom = 6,
|
||||
},
|
||||
widget = wibox.container.arcchart
|
||||
})
|
||||
|
||||
return nil, 60
|
|
@ -0,0 +1,81 @@
|
|||
--DOC_HIDE_ALL
|
||||
local parent = ...
|
||||
local wibox = require( "wibox" )
|
||||
local beautiful = require( "beautiful" )
|
||||
|
||||
parent:add(wibox.widget {
|
||||
{
|
||||
{
|
||||
markup = "<b>rounded_edge</b> = <i>false</i>",
|
||||
widget = wibox.widget.textbox
|
||||
},
|
||||
{
|
||||
{
|
||||
{
|
||||
colors = {
|
||||
beautiful.bg_normal,
|
||||
beautiful.bg_highlight,
|
||||
beautiful.border_color,
|
||||
},
|
||||
values = {
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
},
|
||||
max_value = 10,
|
||||
min_value = 0,
|
||||
rounded_edge = false,
|
||||
bg = "#ff000033",
|
||||
border_width = 0.5,
|
||||
border_color = "#000000",
|
||||
widget = wibox.container.arcchart
|
||||
},
|
||||
margins = 2,
|
||||
colors = {
|
||||
beautiful.bg_normal,
|
||||
beautiful.bg_highlight,
|
||||
beautiful.border_color,
|
||||
},
|
||||
layout = wibox.container.margin
|
||||
},
|
||||
margins = 1,
|
||||
color = beautiful.border_color,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
layout = wibox.layout.fixed.vertical
|
||||
},
|
||||
{
|
||||
{
|
||||
markup = "<b>rounded_edge</b> = <i>true</i>",
|
||||
widget = wibox.widget.textbox
|
||||
},
|
||||
{
|
||||
{
|
||||
colors = {
|
||||
beautiful.bg_normal,
|
||||
beautiful.bg_highlight,
|
||||
beautiful.border_color,
|
||||
},
|
||||
values = {
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
},
|
||||
max_value = 10,
|
||||
min_value = 0,
|
||||
rounded_edge = true,
|
||||
bg = "#ff000033",
|
||||
border_width = 0.5,
|
||||
border_color = "#000000",
|
||||
widget = wibox.container.arcchart
|
||||
},
|
||||
margins = 1,
|
||||
color = beautiful.border_color,
|
||||
layout = wibox.container.margin,
|
||||
},
|
||||
layout = wibox.layout.fixed.vertical
|
||||
},
|
||||
layout = wibox.layout.flex.horizontal
|
||||
})
|
||||
|
||||
return 500, 60
|
|
@ -0,0 +1,35 @@
|
|||
--DOC_HIDE_ALL
|
||||
local parent = ...
|
||||
local wibox = require( "wibox" )
|
||||
local beautiful = require( "beautiful" )
|
||||
|
||||
local l = wibox.layout.fixed.horizontal()
|
||||
l.spacing = 10
|
||||
parent:add(l)
|
||||
|
||||
for _, v in ipairs {0, math.pi/2, math.pi} do
|
||||
l:add(wibox.widget {
|
||||
{
|
||||
text = v,
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
colors = {
|
||||
beautiful.bg_normal,
|
||||
beautiful.bg_highlight,
|
||||
beautiful.border_color,
|
||||
},
|
||||
value = 1,
|
||||
max_value = 10,
|
||||
min_value = 0,
|
||||
rounded_edge = false,
|
||||
bg = "#ff000033",
|
||||
start_angle = v,
|
||||
border_width = 0.5,
|
||||
border_color = "#000000",
|
||||
widget = wibox.container.arcchart
|
||||
})
|
||||
end
|
||||
|
||||
return nil, 60
|
|
@ -0,0 +1,39 @@
|
|||
--DOC_HIDE_ALL
|
||||
local parent = ...
|
||||
local wibox = require( "wibox" )
|
||||
local beautiful = require( "beautiful" )
|
||||
|
||||
local l = wibox.layout.fixed.horizontal()
|
||||
l.spacing = 10
|
||||
parent:add(l)
|
||||
|
||||
for _, v in ipairs {1,3,7,10} do
|
||||
l:add(wibox.widget {
|
||||
{
|
||||
text = v,
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
colors = {
|
||||
beautiful.bg_normal,
|
||||
beautiful.bg_highlight,
|
||||
beautiful.border_color,
|
||||
},
|
||||
values = {
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
},
|
||||
max_value = 10,
|
||||
min_value = 0,
|
||||
rounded_edge = false,
|
||||
thickness = v,
|
||||
bg = "#ff000033",
|
||||
border_width = 0.5,
|
||||
border_color = "#000000",
|
||||
widget = wibox.container.arcchart
|
||||
})
|
||||
end
|
||||
|
||||
return nil, 60
|
|
@ -0,0 +1,28 @@
|
|||
--DOC_HIDE_ALL
|
||||
local parent = ...
|
||||
local wibox = require( "wibox" )
|
||||
local beautiful = require( "beautiful" )
|
||||
|
||||
local l = wibox.layout.fixed.horizontal()
|
||||
l.spacing = 10
|
||||
parent:add(l)
|
||||
|
||||
for _, v in ipairs {0,1,7,99} do
|
||||
l:add(wibox.widget {
|
||||
colors = {
|
||||
beautiful.bg_normal,
|
||||
beautiful.bg_highlight,
|
||||
beautiful.border_color,
|
||||
},
|
||||
value = v,
|
||||
max_value = 10,
|
||||
min_value = 0,
|
||||
rounded_edge = false,
|
||||
bg = "#ff000033",
|
||||
border_width = 0.5,
|
||||
border_color = "#000000",
|
||||
widget = wibox.container.arcchart
|
||||
})
|
||||
end
|
||||
|
||||
return nil, 60
|
|
@ -0,0 +1,45 @@
|
|||
--DOC_HIDE_ALL
|
||||
local wibox = require("wibox")
|
||||
local beautiful = require("beautiful")
|
||||
|
||||
return {
|
||||
text = "Before",
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
{
|
||||
{
|
||||
{
|
||||
text = "After",
|
||||
align = "center",
|
||||
valign = "center",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
colors = {
|
||||
beautiful.bg_normal,
|
||||
beautiful.bg_highlight,
|
||||
beautiful.border_color,
|
||||
},
|
||||
values = {
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
},
|
||||
max_value = 10,
|
||||
min_value = 0,
|
||||
rounded_edge = true,
|
||||
bg = "#ff000033",
|
||||
border_width = 0.5,
|
||||
border_color = "#000000",
|
||||
start_angle = 0,
|
||||
widget = wibox.container.arcchart
|
||||
},
|
||||
margins = 2,
|
||||
colors = {
|
||||
beautiful.bg_normal,
|
||||
beautiful.bg_highlight,
|
||||
beautiful.border_color,
|
||||
},
|
||||
layout = wibox.container.margin
|
||||
}
|
Loading…
Reference in New Issue