doc: Document the tile container.

This commit is contained in:
Emmanuel Lepage Vallee 2021-04-19 01:21:10 -07:00
parent 738e2e0467
commit dd26b8180d
6 changed files with 223 additions and 0 deletions

View File

@ -0,0 +1,25 @@
--DOC_HIDE_ALL
--DOC_GEN_IMAGE
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,
},
valign = "bottom",
halign = "right",
widget = wibox.container.tile
},
margins = 5,
layout = wibox.container.margin
}

View File

@ -0,0 +1,42 @@
--DOC_GEN_IMAGE --DOC_HIDE
local parent = ... --DOC_HIDE
local wibox = require("wibox") --DOC_HIDE
local beautiful = require( "beautiful" ) --DOC_HIDE
local l = wibox.layout { --DOC_HIDE
forced_width = 240, --DOC_HIDE
spacing = 5, --DOC_HIDE
layout = wibox.layout.flex.vertical --DOC_HIDE
} --DOC_HIDE
for _, i in ipairs {true, false} do
local w = wibox.widget {
{
{
image = beautiful.awesome_icon,
forced_height = 30,
forced_width = 30,
widget = wibox.widget.imagebox
},
forced_height = 80, --DOC_HIDE
horizontal_crop = i,
widget = wibox.container.tile
},
bg = "#ff0000",
widget = wibox.container.background
}
l:add(wibox.widget {--DOC_HIDE
{--DOC_HIDE
markup = "<b>`horizontal_crop` = "..(i and "true" or "false").."</b>",--DOC_HIDE
widget = wibox.widget.textbox,--DOC_HIDE
},--DOC_HIDE
w,--DOC_HIDE
layout = wibox.layout.fixed.vertical,--DOC_HIDE
}) --DOC_HIDE
end
parent:add(l) --DOC_HIDE
--DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80

View File

@ -0,0 +1,38 @@
--DOC_GEN_IMAGE --DOC_HIDE
local parent = ... --DOC_HIDE
local wibox = require("wibox") --DOC_HIDE
local beautiful = require( "beautiful" ) --DOC_HIDE
local l = wibox.layout { --DOC_HIDE
forced_width = 240, --DOC_HIDE
spacing = 5, --DOC_HIDE
layout = wibox.layout.flex.vertical --DOC_HIDE
} --DOC_HIDE
for _, i in ipairs {0, 2, 5, 10} do
local w = wibox.widget {
{
image = beautiful.awesome_icon,
forced_height = 30,
forced_width = 30,
widget = wibox.widget.imagebox
},
valign = "top",
halign = "left",
horizontal_spacing = i,
widget = wibox.container.tile
}
l:add(wibox.widget {--DOC_HIDE
{--DOC_HIDE
markup = "<b>`horizontal_spacing` = "..i.."</b>",--DOC_HIDE
widget = wibox.widget.textbox,--DOC_HIDE
},--DOC_HIDE
w,--DOC_HIDE
layout = wibox.layout.fixed.vertical,--DOC_HIDE
}) --DOC_HIDE
end
parent:add(l) --DOC_HIDE
--DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80

View File

@ -0,0 +1,36 @@
--DOC_GEN_IMAGE --DOC_HIDE
local parent = ... --DOC_HIDE
local wibox = require("wibox") --DOC_HIDE
local beautiful = require( "beautiful" ) --DOC_HIDE
local l = wibox.layout { --DOC_HIDE
forced_width = 240, --DOC_HIDE
spacing = 5, --DOC_HIDE
layout = wibox.layout.flex.vertical --DOC_HIDE
} --DOC_HIDE
for _, i in ipairs {true, false} do
local w = wibox.widget {
{
image = beautiful.awesome_icon,
forced_height = 30,
forced_width = 30,
widget = wibox.widget.imagebox
},
tiled = i,
widget = wibox.container.tile
}
l:add(wibox.widget {--DOC_HIDE
{--DOC_HIDE
markup = "<b>`tiled` = "..(i and "true" or "false").."</b>",--DOC_HIDE
widget = wibox.widget.textbox,--DOC_HIDE
},--DOC_HIDE
w,--DOC_HIDE
layout = wibox.layout.fixed.vertical,--DOC_HIDE
}) --DOC_HIDE
end
parent:add(l) --DOC_HIDE
--DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80

View File

@ -0,0 +1,41 @@
--DOC_GEN_IMAGE --DOC_HIDE
local parent = ... --DOC_HIDE
local wibox = require("wibox") --DOC_HIDE
local beautiful = require( "beautiful" ) --DOC_HIDE
local l = wibox.layout { --DOC_HIDE
forced_width = 240, --DOC_HIDE
spacing = 5, --DOC_HIDE
layout = wibox.layout.flex.vertical --DOC_HIDE
} --DOC_HIDE
for _, i in ipairs {true, false} do
local w = wibox.widget {
{
{
image = beautiful.awesome_icon,
forced_height = 30,
forced_width = 30,
widget = wibox.widget.imagebox
},
forced_height = 80, --DOC_HIDE
vertical_crop = i,
widget = wibox.container.tile
},
bg = "#ff0000",
widget = wibox.container.background
}
l:add(wibox.widget {--DOC_HIDE
{--DOC_HIDE
markup = "<b>`vertical_crop` = "..(i and "true" or "false").."</b>",--DOC_HIDE
widget = wibox.widget.textbox,--DOC_HIDE
},--DOC_HIDE
w,--DOC_HIDE
layout = wibox.layout.fixed.vertical,--DOC_HIDE
}) --DOC_HIDE
end
parent:add(l) --DOC_HIDE
--DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80

View File

@ -0,0 +1,41 @@
--DOC_GEN_IMAGE --DOC_HIDE
local parent = ... --DOC_HIDE
local wibox = require("wibox") --DOC_HIDE
local beautiful = require( "beautiful" ) --DOC_HIDE
local l = wibox.layout { --DOC_HIDE
forced_width = 640, --DOC_HIDE
forced_height = 120, --DOC_HIDE
spacing = 5, --DOC_HIDE
layout = wibox.layout.flex.horizontal --DOC_HIDE
} --DOC_HIDE
for _, i in ipairs {0, 2, 5, 10} do
local w = wibox.widget {
{
image = beautiful.awesome_icon,
forced_height = 30,
forced_width = 30,
widget = wibox.widget.imagebox
},
forced_width = 20, --DOC_HIDE
forced_height = 100, --DOC_HIDE
valign = "top",
halign = "left",
vertical_spacing = i,
widget = wibox.container.tile
}
l:add(wibox.widget {--DOC_HIDE
{--DOC_HIDE
markup = "<b>`vertical_spacing` = "..i.."</b>",--DOC_HIDE
widget = wibox.widget.textbox,--DOC_HIDE
},--DOC_HIDE
w,--DOC_HIDE
layout = wibox.layout.fixed.vertical,--DOC_HIDE
}) --DOC_HIDE
end
parent:add(l) --DOC_HIDE
--DOC_HIDE vim: filetype=lua:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:textwidth=80