doc: Document the place container.

This commit is contained in:
Emmanuel Lepage Vallee 2021-04-19 01:39:41 -07:00
parent dd26b8180d
commit ee0d793efe
7 changed files with 178 additions and 2 deletions

View File

@ -107,6 +107,8 @@ end
-- * *center* (default)
-- * *bottom*
--
--@DOC_wibox_container_place_valign_EXAMPLE@
--
-- @property valign
-- @tparam[opt="center"] string valign
-- @propemits true false
@ -119,6 +121,8 @@ end
-- * *center* (default)
-- * *right*
--
--@DOC_wibox_container_place_halign_EXAMPLE@
--
-- @property halign
-- @tparam[opt="center"] string halign
-- @propemits true false
@ -169,6 +173,8 @@ end
--- Stretch the contained widget so it takes all the vertical space.
--
--@DOC_wibox_container_place_content_fill_vertical_EXAMPLE@
--
-- @property content_fill_vertical
-- @tparam[opt=false] boolean content_fill_vertical
-- @propemits true false
@ -181,6 +187,8 @@ end
--- Stretch the contained widget so it takes all the horizontal space.
--
--@DOC_wibox_container_place_content_fill_horizontal_EXAMPLE@
--
-- @property content_fill_horizontal
-- @tparam[opt=false] boolean content_fill_horizontal
-- @propemits true false

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 = 340, --DOC_HIDE
spacing = 5, --DOC_HIDE
layout = wibox.layout.flex.horizontal --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
},
bg = "#ff0000",
widget = wibox.container.background
},
forced_height = 80, --DOC_HIDE
forced_width = 120, --DOC_HIDE
content_fill_horizontal = i,
widget = wibox.container.place
}
l:add(wibox.widget {--DOC_HIDE
{--DOC_HIDE
markup = "<b>`content_fill_horizontal` = "..(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,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 = 340, --DOC_HIDE
spacing = 5, --DOC_HIDE
layout = wibox.layout.flex.horizontal --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
},
bg = "#ff0000",
widget = wibox.container.background
},
forced_height = 80, --DOC_HIDE
forced_width = 120, --DOC_HIDE
content_fill_vertical = i,
widget = wibox.container.place
}
l:add(wibox.widget {--DOC_HIDE
{--DOC_HIDE
markup = "<b>`content_fill_vertical` = "..(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,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 = 340, --DOC_HIDE
spacing = 5, --DOC_HIDE
layout = wibox.layout.flex.horizontal --DOC_HIDE
} --DOC_HIDE
for _, i in ipairs {"left", "center", "right"} do
local w = wibox.widget {
{
{
image = beautiful.awesome_icon,
forced_height = 30,
forced_width = 30,
widget = wibox.widget.imagebox
},
halign = i,
widget = wibox.container.place
},
bg = beautiful.bg_normal,
forced_height = 80, --DOC_HIDE
forced_width = 120, --DOC_HIDE
widget = wibox.container.background
}
l:add(wibox.widget {--DOC_HIDE
{--DOC_HIDE
markup = "<b>`halign` = "..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,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 = 340, --DOC_HIDE
spacing = 5, --DOC_HIDE
layout = wibox.layout.flex.horizontal --DOC_HIDE
} --DOC_HIDE
for _, i in ipairs {"top", "center", "bottom"} do
local w = wibox.widget {
{
{
image = beautiful.awesome_icon,
forced_height = 30,
forced_width = 30,
widget = wibox.widget.imagebox
},
valign = i,
widget = wibox.container.place
},
bg = beautiful.bg_normal,
forced_height = 80, --DOC_HIDE
forced_width = 120, --DOC_HIDE
widget = wibox.container.background
}
l:add(wibox.widget {--DOC_HIDE
{--DOC_HIDE
markup = "<b>`valign` = "..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

@ -22,7 +22,7 @@ for _, i in ipairs {true, false} do
horizontal_crop = i,
widget = wibox.container.tile
},
bg = "#ff0000",
bg = beautiful.bg_normal,
widget = wibox.container.background
}

View File

@ -22,7 +22,7 @@ for _, i in ipairs {true, false} do
vertical_crop = i,
widget = wibox.container.tile
},
bg = "#ff0000",
bg = beautiful.bg_normal,
widget = wibox.container.background
}