Expand description
Item — a row in a dropped menu — and card, the panel that paints a
list of them plus the panels its Item::Submenu rows drop.
Every menu in the system is those two over the caller’s own open state: the
bar’s dropped panel (crate::menubar), the ··· on a row, the picker
under a chip. The state stays with the caller because only it knows what
opening means — a crate::popover::Popup for one, a field for another.
Cursor is the one piece of state the card asks for: which submenus are
down and which row is live. Pointer and keyboard both move it, so the two
can never disagree about which row an open submenu hangs off. What the
pointer did comes back as a Hit; acting on it stays the caller’s.
Structs§
- Cursor
- Where an open menu is being worked:
openis the chain of submenu rows currently down, outermost first, androwis the live row in the menu that chain ends at.
Enums§
- Hit
- What the pointer did to a menu. Every variant is a request: the caller’s
Cursorand open state are what answer it. - Item
- A row in a menu.
Functions§
- at
- The item
pathnames — one row index per level, outermost first. - card
- The panel a menu drops: every
Itemas a row, in apopover::popover_card, with a further panel hanging off each submenu row theCursorholds open.idprefixes the rows’ element ids, so two menus open at once keep their hover state apart. - items_
at - The menu
pathopens into:itemsitself for an empty path, else the rows of the submenu each index names.Noneas soon as one of them does not name an open-able submenu. - next_
selectable - The next row the keyboard can land on,
deltadeciding the direction: separators and disabled rows are stepped straight over, and both ends wrap.fromofNoneenters the menu at the edge the direction comes from.