Class wibox.widget.checkbox
A boolean display widget.
If necessary, themes can implement custom shape:
wibox.widget { checked = true, color = beautiful.bg_normal, paddings = 2, check_shape = function(cr, width, height) local rs = math.min(width, height) cr:move_to( 0 , 0 ) cr:line_to( rs , 0 ) cr:move_to( 0 , 0 ) cr:line_to( 0 , rs ) cr:move_to( 0 , rs ) cr:line_to( rs , rs ) cr:move_to( rs , 0 ) cr:line_to( rs , rs ) cr:move_to( 0 , 0 ) cr:line_to( rs , rs ) cr:move_to( 0 , rs ) cr:line_to( rs , 0 ) end, check_border_color = '#ff0000', check_color = '#00000000', check_border_width = 1, widget = wibox.widget.checkbox }
Usage:
wibox.widget { checked = true, color = beautiful.bg_normal, paddings = 2, shape = gears.shape.circle, widget = wibox.widget.checkbox }
Info:
- Copyright: 2010 Emmanuel Lepage Vallee
- Author: Emmanuel Lepage Valle
Object properties
wibox.widget.checkbox.border_width | The outer (unchecked area) border width. |
wibox.widget.checkbox.bg | The outer (unchecked area) background color, pattern or gradient. |
wibox.widget.checkbox.border_color | The outer (unchecked area) border color. |
wibox.widget.checkbox.check_border_color | The checked part border color. |
wibox.widget.checkbox.check_border_width | The checked part border width. |
wibox.widget.checkbox.check_color | The checked part filling color. |
wibox.widget.checkbox.shape | The outer (unchecked area) shape. |
wibox.widget.checkbox.check_shape | The checked part shape. |
wibox.widget.checkbox.paddings | The padding between the outline and the progressbar. |
wibox.widget.checkbox.color | The checkbox color. |
wibox.widget.checkbox.checked | If the checkbox is checked. |
wibox.widget.checkbox.color | The checkbox color. |
Theme variables
beautiful.checkbox_border_width | The outer (unchecked area) border width. |
beautiful.checkbox_bg | The outer (unchecked area) background color, pattern or gradient. |
beautiful.checkbox_border_color | The outer (unchecked area) border color. |
beautiful.checkbox_check_border_color | The checked part border color. |
beautiful.checkbox_check_border_width | The checked part border width. |
beautiful.checkbox_check_color | The checked part filling color. |
beautiful.checkbox_shape | The outer (unchecked area) shape. |
beautiful.checkbox_check_shape | The checked part shape. |
beautiful.checkbox_paddings | The padding between the outline and the progressbar. |
beautiful.checkbox_color | The checkbox color. |
Object properties
- wibox.widget.checkbox.border_width
- The outer (unchecked area) border width.
- wibox.widget.checkbox.bg
-
The outer (unchecked area) background color, pattern or gradient.
Usage:
wibox.widget { checked = true, color = beautiful.bg_normal, bg = '#ff00ff', border_width = 3, paddings = 4, border_color = '#0000ff', check_color = '#ff0000', check_border_color = '#ffff00', check_border_width = 1, widget = wibox.widget.checkbox }
- wibox.widget.checkbox.border_color
- The outer (unchecked area) border color.
- wibox.widget.checkbox.check_border_color
- The checked part border color.
- wibox.widget.checkbox.check_border_width
- The checked part border width.
- wibox.widget.checkbox.check_color
- The checked part filling color.
- wibox.widget.checkbox.shape
-
The outer (unchecked area) shape.
See also:
Usage:
for _, s in ipairs {'rectangle', 'circle', 'losange', 'octogon'} do wibox.widget { checked = true, color = beautiful.bg_normal, paddings = 2, shape = gears.shape[s], widget = wibox.widget.checkbox } end
- wibox.widget.checkbox.check_shape
-
The checked part shape.
If none is set, then the shape property will be used.
See also:
Usage:
for _, s in ipairs {'rectangle', 'circle', 'losange', 'octogon'} do wibox.widget { checked = true, color = beautiful.bg_normal, paddings = 2, check_shape = gears.shape[s], widget = wibox.widget.checkbox } end
- wibox.widget.checkbox.paddings
-
The padding between the outline and the progressbar.
Type:
- paddings A number or a table
- top number (default 0)
- bottom number (default 0)
- left number (default 0)
- right number (default 0)
- paddings A number or a table
- wibox.widget.checkbox.color
- The checkbox color. This will be used for the unchecked part border color and the checked part filling color. Note that check_color and border_color have priority over this property.
- wibox.widget.checkbox.checked
-
If the checkbox is checked.
Type:
- boolean
- wibox.widget.checkbox.color
- The checkbox color.
Theme variables
- beautiful.checkbox_border_width
- The outer (unchecked area) border width.
- beautiful.checkbox_bg
- The outer (unchecked area) background color, pattern or gradient.
- beautiful.checkbox_border_color
- The outer (unchecked area) border color.
- beautiful.checkbox_check_border_color
- The checked part border color.
- beautiful.checkbox_check_border_width
- The checked part border width.
- beautiful.checkbox_check_color
- The checked part filling color.
- beautiful.checkbox_shape
-
The outer (unchecked area) shape.
See also:
- beautiful.checkbox_check_shape
-
The checked part shape.
If none is set, then the shape property will be used.
See also:
- beautiful.checkbox_paddings
-
The padding between the outline and the progressbar.
Type:
- paddings A number or a table
- top number (default 0)
- bottom number (default 0)
- left number (default 0)
- right number (default 0)
- paddings A number or a table
- beautiful.checkbox_color
- The checkbox color. This will be used for the unchecked part border color and the checked part filling color. Note that check_color and border_color have priority over this property.