pub struct MenuState {
pub open_item: Option<Id>,
/* private fields */
}
Expand description
Holds the state of the menu.
Fields§
§open_item: Option<Id>
The currently open sub menu in this menu.
Implementations§
Source§impl MenuState
impl MenuState
pub const ID: &'static str = "menu_state"
Sourcepub fn from_ui<R>(ui: &Ui, f: impl FnOnce(&mut Self, &UiStack) -> R) -> R
pub fn from_ui<R>(ui: &Ui, f: impl FnOnce(&mut Self, &UiStack) -> R) -> R
Find the root of the menu and get the state
Sourcepub fn from_id<R>(ctx: &Context, id: Id, f: impl FnOnce(&mut Self) -> R) -> R
pub fn from_id<R>(ctx: &Context, id: Id, f: impl FnOnce(&mut Self) -> R) -> R
Get the state via the menus root Ui
id
Is the menu with this id the deepest sub menu? (-> no child sub menu is open)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MenuState
impl RefUnwindSafe for MenuState
impl Send for MenuState
impl Sync for MenuState
impl Unpin for MenuState
impl UnwindSafe for MenuState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more