# Module `wibox.layout.flex`

### Info:

- Author: Uli Schlachter
- Copyright: 2010 Uli Schlachter
- Release: v3.5.1

## Functions

flex:draw (wibox, cr, width, height) | Draw a flex layout.
flex:set_max_widget_size (val) | Set the maximum size the widgets in this layout will take (that is, maximum width for horizontal and maximum height for vertical).
flex:fit (orig_width, orig_height) | Fit the flex layout into the given space.
horizontal () | Returns a new horizontal flex layout.
vertical () | Returns a new vertical flex layout.

## Functions

flex:draw (wibox, cr, width, height)
  Draw a flex layout. Each widget gets an equal share of the available space.

  ### Parameters:

  - wibox The wibox that this widget is drawn to.
  - cr The cairo context to use.
  - width The available width.
  - height The available height.

  ### Returns:

  The total space needed by the layout.
flex:set_max_widget_size (val)
  Set the maximum size the widgets in this layout will take (that is, maximum width for horizontal and maximum height for vertical).

  ### Parameters:

  - val The maximum size of the widget.
flex:fit (orig_width, orig_height)
  Fit the flex layout into the given space.

  ### Parameters:

  - orig_width The available width.
  - orig_height The available height.
horizontal ()
  Returns a new horizontal flex layout. A flex layout shares the available space equally among all widgets. Widgets can be added via :add(widget).
vertical ()
  Returns a new vertical flex layout. A flex layout shares the available space equally among all widgets. Widgets can be added via :add(widget).

generated by LDoc 1.3