Toddy.Iced.Alignment (Toddy v0.3.0)

Copy Markdown View Source

Alignment values for align_x and align_y widget props.

Horizontal: :left, :center, :right (aliases: :start = :left, :end = :right). Vertical: :top, :center, :bottom (aliases: :start = :top, :end = :bottom).

Summary

Functions

Encodes an alignment value to the wire format.

Types

horizontal()

@type horizontal() :: :left | :center | :right | :start | :end

t()

@type t() :: horizontal() | vertical()

vertical()

@type vertical() :: :top | :center | :bottom | :start | :end

Functions

encode(value)

@spec encode(alignment :: t()) :: String.t()

Encodes an alignment value to the wire format.

Examples

iex> Toddy.Iced.Alignment.encode(:left)
"left"

iex> Toddy.Iced.Alignment.encode(:center)
"center"

iex> Toddy.Iced.Alignment.encode(:right)
"right"

iex> Toddy.Iced.Alignment.encode(:top)
"top"

iex> Toddy.Iced.Alignment.encode(:bottom)
"bottom"

iex> Toddy.Iced.Alignment.encode(:start)
"start"

iex> Toddy.Iced.Alignment.encode(:end)
"end"