View Source ExSni.Menu.Item (ExSNI v0.2.9)

Link to this section Summary

Link to this section Types

Specs

dbus_menu_item() :: {integer(), dbus_menu_properties(), [dbus_menu_item()]}
Link to this type

dbus_menu_properties()

View Source

Specs

dbus_menu_properties() :: [{String.t(), dbus_variant()}]

Specs

dbus_variant() :: {:dbus_variant, any(), any()}

Specs

id() :: non_neg_integer()

Specs

item_type() :: :separator | :root | :standard | :checkbox | :radio | :menu

Specs

layout() :: {:dbus_variant, {:struct, list()}, dbus_menu_item()}

Specs

t() :: %ExSni.Menu.Item{
  callbacks: [ExSni.Menu.callback()],
  checked: boolean(),
  children: [t()],
  enabled: boolean(),
  icon: nil | String.t() | ExSni.Icon.Info.t(),
  id: id(),
  label: String.t(),
  type: item_type(),
  uid: String.t(),
  visible: boolean()
}

Specs

toggle_state() :: nil | :on | :off

Specs

toggle_type() :: nil | :checkmark | :radio

Link to this section Functions

Specs

disable(t()) :: t()

Specs

enable(t()) :: t()

Specs

find_item(t(), id()) :: nil | t()
Link to this function

get_changed_properties(current, other)

View Source
Link to this function

get_changed_properties(current, other, list)

View Source

Specs

get_changed_properties(current :: t(), other :: t(), properties :: [atom()]) ::
  [atom()]
Link to this function

get_dbus_changed_properties(current, other, opts \\ [])

View Source
Link to this function

get_layout(menu_item, depth, properties)

View Source

Specs

get_layout(t(), integer(), [String.t()]) :: layout()

Specs

hidden(t()) :: t()

Specs

root(children :: [t()]) :: t()

Specs

separator() :: t()
Link to this function

set_callbacks(item, callbacks)

View Source

Specs

set_callbacks(t(), callbacks :: [ExSni.Menu.callback()]) :: t()
Link to this function

set_checked(item, value \\ true)

View Source

Specs

set_checked(t(), new_state :: boolean()) :: t()
Link to this function

set_enabled(item, value)

View Source

Specs

set_enabled(t(), value :: boolean()) :: t()

Specs

set_id(t(), id :: id()) :: t()

WARNING: Always use unique IDs across the entire tree. If you set the same ID for a node and any of its descendants, most menu hosts (i.e. libdbusmenu) will recurse indefinitely when attempting to build the list of IDs to request the layout for; which will most likely result in a system-wide crash/hang.

To store custom ID (e.g. "id" attribute), use uid property and set_uid/2

Specs

set_label(t(), label :: String.t()) :: t()

Specs

set_uid(t(), uid :: String.t()) :: t()
Link to this function

set_visible(item, value)

View Source

Specs

set_visible(t(), value :: boolean()) :: t()

Specs

standard(label :: String.t()) :: t()

Specs

toggle_checked(t()) :: t()

Specs

toggle_enabled(t()) :: t()

Specs

toggle_visible(t()) :: t()

Specs

visible(t()) :: t()