Menu

Enum

MenuItem

kurogane::MenuItemSource
#[non_exhaustive] pub enum MenuItem { Standard(StandardItem), App(AppItem), Submenu(Submenu), Separator, }

An item of a ContextMenu.

Variants

#Standard(StandardItem)

One of Kurogane’s items.

#App(AppItem)

An item of the application’s, which reports its choice to App::on_context_menu_command.

#Submenu(Submenu)

A submenu.

#Separator

A line between groups of items. One at an edge of a menu, or next to another, is not shown.

Methods

#pub fn new(id: impl Into<String>, label: impl Into<String>) -> Self

An item of the application’s. Choosing it calls App::on_context_menu_command with id.

In a window’s menu an & in label marks the letter that chooses it from the keyboard and && shows an &. An embedded browser’s menu, which CEF draws, takes every & out of a label. There a typed letter chooses the item whose label begins with it. A label cannot show an &.

#pub fn separator() -> Self

A line between groups of items.

#pub fn submenu( label: impl Into<String>, items: impl IntoIterator<Item = MenuItem>, ) -> Self

A submenu of items, under label.

Trait implementations