snowhite v2.1.3 Snowhite.Builder.Layout View Source

Represents modules disposition on a 3 by 3 layout. Modules are registered as {module, args}.

Link to this section Summary

Functions

Gets all layout's modules without their positions

Gets a all possible positions which are top_left, top_center, top_right, middle_left, middle_center, middle_right, bottom_left, bottom_center, bottom_right

Puts a module in a given layout in the right position. This is the main function used for building layouts

Link to this section Types

Specs

module_definition() :: {atom(), keyword()}

Specs

position() ::
  :top_left
  | :top_center
  | :top_right
  | :middle_left
  | :middle_center
  | :middle_right
  | :bottom_left
  | :bottom_center
  | :bottom_right

Specs

t() :: %Snowhite.Builder.Layout{
  bottom_center: term(),
  bottom_left: term(),
  bottom_right: term(),
  middle_center: term(),
  middle_left: term(),
  middle_right: term(),
  top_center: term(),
  top_left: term(),
  top_right: term()
}

Link to this section Functions

Specs

modules(t()) :: [module_definition()]

Gets all layout's modules without their positions

Specs

positions() :: [position()]

Gets a all possible positions which are top_left, top_center, top_right, middle_left, middle_center, middle_right, bottom_left, bottom_center, bottom_right

Link to this function

put_module(layout, position, module)

View Source

Specs

put_module(t(), position(), module_definition()) :: t()

Puts a module in a given layout in the right position. This is the main function used for building layouts