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

Copy Markdown View Source

Per-subtree theme override -- applies a different theme to child widgets.

Props

  • theme -- a built-in theme atom (e.g. :dark, :nord) or a custom palette map. See Toddy.Iced.Theme.
  • a11y (map) -- accessibility overrides. See Toddy.Iced.A11y.

Summary

Functions

Sets accessibility annotations.

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

Appends multiple children to the themer.

Creates a new themer struct with the given theme.

Appends a child to the themer.

Types

t()

@type t() :: %Toddy.Iced.Widget.Themer{
  a11y: Toddy.Iced.A11y.t() | nil,
  children: [Toddy.Iced.ui_node() | struct()],
  id: String.t(),
  theme: Toddy.Iced.Theme.t()
}

Functions

a11y(t, a11y)

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

Sets accessibility annotations.

build(t)

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

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

extend(t, children)

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

Appends multiple children to the themer.

new(id, theme)

@spec new(id :: String.t(), theme :: Toddy.Iced.Theme.t()) :: t()

Creates a new themer struct with the given theme.

push(t, child)

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

Appends a child to the themer.