howdy/ui/context_menu
Context menus: a menu that opens where you right-click, or press the context menu key, inside an area.
context_menu.area("file-actions", [], [file_preview]),
context_menu.menu("file-actions", [], [
menu.item([event.on_click(Rename)], [text("Rename")]),
menu.item([event.on_click(Duplicate)], [text("Duplicate")]),
menu.separator(),
menu.item([event.on_click(Delete)], [text("Delete")]),
])
Its items are howdy/ui/menu items, with the same keys: arrows, Home,
End and typeahead, Escape to close. A context menu is a shortcut, so
offer its actions somewhere visible too: touch screens and many
keyboards have no way to open it.
Values
pub fn area(
id: String,
attributes: List(attribute.Attribute(msg)),
children: List(element.Element(msg)),
) -> element.Element(msg)
The area that opens the menu with this id.
pub fn classes() -> List(css.Class)
Every class this module uses, for howdy/ui/export. The menu is
styled by howdy/ui/menu; the script places it at the pointer.
pub fn menu(
id: String,
attributes: List(attribute.Attribute(msg)),
children: List(element.Element(msg)),
) -> element.Element(msg)