tests: The the piechart widget.

This commit is contained in:
Emmanuel Lepage Vallee 2016-09-08 02:32:53 -04:00
parent 0a3a71dd45
commit 2a976951ea
3 changed files with 121 additions and 0 deletions

View File

@ -0,0 +1,27 @@
--DOC_HIDE_ALL
local parent = ...
local wibox = require( "wibox" )
local beautiful = require( "beautiful" )
local l = wibox.layout.fixed.horizontal()
parent:add(l)
for _, v in ipairs {"#ff0000", "#00ff00", "#0000ff"} do
l:add(wibox.widget {
data = {
['L1'] = 100,
['L2'] = 200,
['L3'] = 300,
},
border_width = 1,
border_color = v,
forced_height = 50,
forced_width = 100,
colors = {
beautiful.bg_normal,
beautiful.bg_highlight,
beautiful.border_color,
},
widget = wibox.widget.piechart
})
end

View File

@ -0,0 +1,26 @@
--DOC_HIDE_ALL
local parent = ...
local wibox = require( "wibox" )
local beautiful = require( "beautiful" )
local l = wibox.layout.fixed.horizontal()
parent:add(l)
for _, v in ipairs {0,1,3,5} do
l:add(wibox.widget {
data = {
['L1'] = 100,
['L2'] = 200,
['L3'] = 300,
},
border_width = v,
forced_height = 50,
forced_width = 100,
colors = {
beautiful.bg_normal,
beautiful.bg_highlight,
beautiful.border_color,
},
widget = wibox.widget.piechart
})
end

View File

@ -0,0 +1,68 @@
--DOC_HIDE_ALL
local parent = ...
local wibox = require( "wibox" )
local beautiful = require( "beautiful" )
parent:add(wibox.widget {
{
{
markup = "<b>display_labels</b> = <i>false</i>",
widget = wibox.widget.textbox
},
{
{
data = {
['L1'] = 100,
['L2'] = 200,
['L3'] = 300,
},
border_width = 1,
forced_height = 50,
forced_width = 100,
display_labels = false,
colors = {
beautiful.bg_normal,
beautiful.bg_highlight,
beautiful.border_color,
},
widget = wibox.widget.piechart
},
margins = 1,
color = beautiful.border_color,
layout = wibox.container.margin,
},
layout = wibox.layout.fixed.vertical
},
{
{
markup = "<b>display_labels</b> = <i>true</i>",
widget = wibox.widget.textbox
},
{
{
data = {
['L1'] = 100,
['L2'] = 200,
['L3'] = 300,
},
border_width = 1,
forced_height = 50,
forced_width = 100,
display_labels = true,
colors = {
beautiful.bg_normal,
beautiful.bg_highlight,
beautiful.border_color,
},
widget = wibox.widget.piechart
},
margins = 1,
color = beautiful.border_color,
layout = wibox.container.margin,
},
layout = wibox.layout.fixed.vertical
},
layout = wibox.layout.flex.horizontal
})
return 500, 60