Function cosmic::widget::menu::items

source ·
pub fn items<'a, A: MenuAction<Message = Message>, L: Into<Cow<'static, str>> + 'static, Message: 'a, Renderer: Renderer + 'a>(
    key_binds: &HashMap<KeyBind, A>,
    children: Vec<MenuItem<A, L>>,
) -> Vec<MenuTree<'a, Message, Renderer>>
where Element<'a, Message, Theme, Renderer>: From<Button<'a, Message>>,
Expand description

Create a list of menu items from a vector of MenuItem.

The MenuItem can be either an action or a separator.

§Arguments

  • key_binds - A reference to a HashMap that maps KeyBind to A.
  • children - A vector of MenuItem.

§Returns

  • A vector of MenuTree.