1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
// From iced_aw, license MIT
//! A [`MenuBar`] widget for displaying [`MenuTree`]s
//!
//! *This API requires the following crate features to be activated: `menu`*
//!
//! # Example
//!
//! ```ignore
//! use iced::widget::button;
//! use iced_aw::menu::{MenuTree, MenuBar};
//!
//! let sub_2 = MenuTree::with_children(
//! button("Sub Menu 2"),
//! vec![
//! MenuTree::new(button("item_1")),
//! MenuTree::new(button("item_2")),
//! MenuTree::new(button("item_3")),
//! ]
//! );
//!
//! let sub_1 = MenuTree::with_children(
//! button("Sub Menu 1"),
//! vec![
//! MenuTree::new(button("item_1")),
//! sub_2,
//! MenuTree::new(button("item_2")),
//! MenuTree::new(button("item_3")),
//! ]
//! );
//!
//!
//! let root_1 = MenuTree::with_children(
//! button("Menu 1"),
//! vec![
//! MenuTree::new(button("item_1")),
//! MenuTree::new(button("item_2")),
//! sub_1,
//! MenuTree::new(button("item_3")),
//! ]
//! );
//!
//! let root_2 = MenuTree::with_children(
//! button("Menu 2"),
//! vec![
//! MenuTree::new(button("item_1")),
//! MenuTree::new(button("item_2")),
//! MenuTree::new(button("item_3")),
//! ]
//! );
//!
//! let menu_bar = MenuBar::new(vec![root_1, root_2]);
//!
//! ```
//!
pub mod action;
pub use action::MenuAction as Action;
mod flex;
pub mod key_bind;
pub use key_bind::KeyBind;
mod menu_bar;
pub(crate) use menu_bar::MenuBarState;
pub use menu_bar::{menu_bar as bar, MenuBar};
mod menu_inner;
mod menu_tree;
pub use menu_tree::{
menu_button, menu_items as items, menu_root as root, MenuItem as Item, MenuTree as Tree,
};
pub use crate::style::menu_bar::{Appearance, StyleSheet};
pub(crate) use menu_bar::{menu_roots_children, menu_roots_diff};
pub(crate) use menu_inner::Menu;
pub use menu_inner::{CloseCondition, ItemHeight, ItemWidth, PathHighlight};