Skip to main content

Module items

Module items 

Source
Expand description

The menu content tree: the six node kinds a caller composes, and the surface partitioning the panel renders them through.

§The six kinds

NodeReferenceRow
MenuEntryM3EMenuEntrya plain action row
MenuSelectableM3EMenuSelectableradio-style: carries a value, checks when selected
MenuToggleableM3EMenuToggleablecheckbox-style: carries a checked state
MenuNode::DividerM3EMenuDividera hairline between sections of one surface
MenuGroupM3EMenuGroupa labelled section — its own elevated surface
MenuSubmenuM3EMenuSubmenua row that opens a nested panel

§Surfaces: a group is a container, not an indent

partition_surfaces ports m3eMenuPartitionSurfaces exactly: each top-level MenuGroup becomes its own elevated menu container, and every run of consecutive non-group nodes collapses into one implicit, unlabelled surface. A menu is therefore a stack of cards, not one card with headings.

§Indices

Every rendered row takes one index in a depth-first, pre-order walk of the tree — a divider counts (it is a row), a submenu row counts and its children take the indices that follow, and a MenuGroup counts for nothing of its own (it is a surface, and its label is chrome, not a row). MenuSelection::index reports that number, so a caller matches on a number it can read straight off its own node list. MenuNode::span is how many indices a node and its whole subtree consume (the same shape frust_shadcn’s menu list uses for its own numbering).

Structs§

MenuEntry
A plain action row (M3EMenuEntry). Build one with menu_entry.
MenuGroup
A labelled section rendered as its own elevated surface (M3EMenuGroup). Build one with menu_group.
MenuIcon
An icon slot on a menu row.
MenuSelectable
A radio-style row carrying a value (M3EMenuSelectable). Build one with menu_selectable.
MenuSelection
One activation reported through a panel’s on_select.
MenuSubmenu
A row that opens a nested panel (M3EMenuSubmenu). Build one with menu_submenu.
MenuToggleable
A checkbox-style row (M3EMenuToggleable). Build one with menu_toggleable.

Enums§

MenuAction
What an activated row asks the app to do.
MenuNode
One node in a menu content tree. See the module docs.

Functions§

menu_entry
A plain action row labelled label.
menu_group
A section holding children, unlabelled until MenuGroup::label.
menu_selectable
A radio-style row labelled label, reporting value when chosen.
menu_submenu
A row labelled label opening a nested panel over children.
menu_toggleable
A checkbox-style row labelled label, currently checked.
partition_surfaces
Partition top-level nodes into elevated surface groups — the port of m3eMenuPartitionSurfaces (m3e_menu_node.dart:272).
spans
The total span of nodes — their count plus every nested subtree’s.