Toddy.Iced.Widget.Float (Toddy v0.3.0)

Copy Markdown View Source

Floating overlay -- positions child with optional translation and scaling.

Props

  • translate_x (number) -- horizontal translation in pixels. Default: 0.
  • translate_y (number) -- vertical translation in pixels. Default: 0.
  • scale (number) -- scale factor for the child content.
  • a11y (map) -- accessibility overrides. See Toddy.Iced.A11y.

Summary

Functions

Sets accessibility annotations.

Converts this float struct to a ui_node() map via the Toddy.Iced.Widget protocol.

Appends multiple children to the float.

Creates a new float struct with optional keyword opts.

Appends a child to the float.

Sets the scale factor.

Sets the horizontal translation in pixels.

Sets the vertical translation in pixels.

Applies keyword options to an existing float struct.

Types

option()

@type option() ::
  {:translate_x, number()}
  | {:translate_y, number()}
  | {:scale, number()}
  | {:a11y, Toddy.Iced.A11y.t()}

t()

@type t() :: %Toddy.Iced.Widget.Float{
  a11y: Toddy.Iced.A11y.t() | nil,
  children: [Toddy.Iced.ui_node() | struct()],
  id: String.t(),
  scale: number() | nil,
  translate_x: number() | nil,
  translate_y: number() | nil
}

Functions

a11y(fw, a11y)

@spec a11y(float_widget :: t(), a11y :: Toddy.Iced.A11y.t()) :: t()

Sets accessibility annotations.

build(fw)

@spec build(float_widget :: t()) :: Toddy.Iced.ui_node()

Converts this float struct to a ui_node() map via the Toddy.Iced.Widget protocol.

extend(fw, children)

@spec extend(float_widget :: t(), children :: [Toddy.Iced.ui_node() | struct()]) ::
  t()

Appends multiple children to the float.

new(id, opts \\ [])

@spec new(id :: String.t(), opts :: [option()]) :: t()

Creates a new float struct with optional keyword opts.

push(fw, child)

@spec push(float_widget :: t(), child :: Toddy.Iced.ui_node() | struct()) :: t()

Appends a child to the float.

scale(fw, v)

@spec scale(float_widget :: t(), scale :: number()) :: t()

Sets the scale factor.

translate_x(fw, v)

@spec translate_x(float_widget :: t(), translate_x :: number()) :: t()

Sets the horizontal translation in pixels.

translate_y(fw, v)

@spec translate_y(float_widget :: t(), translate_y :: number()) :: t()

Sets the vertical translation in pixels.

with_options(fw, opts)

@spec with_options(float_widget :: t(), opts :: [option()]) :: t()

Applies keyword options to an existing float struct.