Skip to main content

standard_menu_bar

Function standard_menu_bar 

Source
pub fn standard_menu_bar(
    app_menus: Vec<MenuItem>,
    leading: &[MenuBarRole],
    trailing: &[MenuBarRole],
    stock: impl Fn(MenuBarRole) -> Option<MenuItem>,
) -> Vec<MenuItem>
Expand description

leading are the slots before the app’s own menus and trailing the ones after — each backend passes its platform’s bar (macOS trails Window and Help; KDE trails Settings and Help; GNOME and Windows trail Help alone). stock returns the backend’s house version of a slot, or None where that platform has no such menu. Menus the app tagged with [MenuBarRole] replace the stock one IN PLACE, so an app customizes a standard menu by claiming it rather than by rebuilding the whole bar.

Day API ↩ Guides· daybrite.dev