Module attached
Expand description
What a view gives the element it stands in to do, besides drawing it: a context menu, a
toolbar shown on hover and focus, and a swipe. Each is a described component that
attaches (crate::component::Semantics::attaches): it draws nothing where the view puts
it, and belongs to the view it stands in. A list item holds those of its row
(super::ListItemProps::attached), so the list runs them for each row: the menu on a
right-click, the Menu key or a long press, the toolbar while the row is hovered or holds
focus, the swipe under the finger.
A menu’s content is ordinary components: commands (MenuItemProps), separators
(MenuSeparatorProps) and an emoji bar (EmojiBarProps). The system adds the rest:
what the item offers that the view did not place (item_menu), so every action stays
reachable from the menu whatever a view chose to put first.
Structs§
- Attachments
- What a view gave the element it stands in: its menu, its hover toolbar and its swipe.
- Context
Menu Props - A context menu of the view it stands in: a right-click, the Menu key or a long press opens it. Its commands come first, as the view placed them; the system adds what the item offers that the view did not place and a typing field to filter them. A destructive command runs at once and is undone afterwards, never confirmed first.
- Emoji
BarProps - A row of emoji to react with, at the top of a menu: the ones the person uses most, then a button that opens the emoji picker for any other.
- Hover
Toolbar Props - Controls shown over the trailing edge of the view they stand in while it is hovered or holds focus: quick reactions, Reply. Tab reaches them from the view.
- Menu
Separator Props - A rule between groups of a menu’s commands.
- Swipe
Props - What swiping the view it stands in across does: it follows the finger, uncovers the command and runs it when let go past the threshold, or springs back.
Enums§
- Menu
Part - One part of a menu: a command, a separator or an emoji bar.
Functions§
- item_
menu - The menu of an item: the view’s own content first, as it placed it; then, after a
separator, each command the item offers (
offered, its allowed actions) that the view did not place, so every action stays reachable from the menu. A command is placed when the view has one that runs the same action on the same resource. - menu_
entries - A menu’s parts as the entries of the context menu that shows them. A destructive command runs at once and is undone afterwards (the platform’s rule), never confirmed first; a separator at either end or beside another is dropped.