doc: Add examples for vertical and labelled progressbar
This commit is contained in:
parent
b49b859fac
commit
a8568eb969
|
@ -1,11 +1,20 @@
|
|||
---------------------------------------------------------------------------
|
||||
--- A progressbar widget.
|
||||
--
|
||||
-- To add text on top of the progressbar, a `wibox.layout.stack` can be used:
|
||||
--
|
||||
--@DOC_wibox_widget_progressbar_text_EXAMPLE@
|
||||
--
|
||||
-- To display the progressbar vertically, use a `wibox.container.rotate` widget:
|
||||
--
|
||||
--@DOC_wibox_widget_progressbar_vertical_EXAMPLE@
|
||||
--
|
||||
-- By default, this widget will take all the available size. To prevent this,
|
||||
-- a `wibox.container.constraint` widget or the `forced_width`/`forced_height`
|
||||
-- properties have to be used.
|
||||
--
|
||||
--@DOC_wibox_widget_defaults_progressbar_EXAMPLE@
|
||||
--
|
||||
-- @author Julien Danjou <julien@danjou.info>
|
||||
-- @copyright 2009 Julien Danjou
|
||||
-- @release @AWESOME_VERSION@
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
local parent = ... --DOC_NO_USAGE --DOC_HIDE
|
||||
local wibox = require("wibox") --DOC_HIDE
|
||||
local beautiful = require("beautiful") --DOC_HIDE
|
||||
|
||||
parent:add( --DOC_HIDE
|
||||
|
||||
wibox.widget {
|
||||
{
|
||||
max_value = 1,
|
||||
value = 0.5,
|
||||
forced_height = 20,
|
||||
forced_width = 100,
|
||||
paddings = 1,
|
||||
border_width = 1,
|
||||
border_color = beautiful.border_color,
|
||||
widget = wibox.widget.progressbar,
|
||||
},
|
||||
{
|
||||
text = "50%",
|
||||
widget = wibox.widget.textbox,
|
||||
},
|
||||
layout = wibox.layout.stack
|
||||
}
|
||||
|
||||
) --DOC_HIDE
|
|
@ -0,0 +1,18 @@
|
|||
local parent = ... --DOC_NO_USAGE --DOC_HIDE
|
||||
local wibox = require("wibox") --DOC_HIDE
|
||||
|
||||
parent:add( --DOC_HIDE
|
||||
|
||||
wibox.widget {
|
||||
{
|
||||
max_value = 1,
|
||||
value = 0.33,
|
||||
widget = wibox.widget.progressbar,
|
||||
},
|
||||
forced_height = 100,
|
||||
forced_width = 20,
|
||||
direction = "east",
|
||||
layout = wibox.container.rotate,
|
||||
}
|
||||
|
||||
) --DOC_HIDE
|
Loading…
Reference in New Issue