zng::menu::sub

Trait SubMenuWidgetInfoExt

source
pub trait SubMenuWidgetInfoExt {
    // Required methods
    fn is_submenu(&self) -> bool;
    fn is_submenu_open(&self) -> Option<ReadOnlyVar<bool, ArcVar<bool>>>;
    fn submenu_parent(&self) -> Option<WidgetInfo>;
    fn submenu_ancestors(&self) -> SubMenuAncestors ;
    fn submenu_self_and_ancestors(&self) -> SubMenuAncestors ;
    fn submenu_root(&self) -> Option<WidgetInfo>;
    fn menu(&self) -> Option<WidgetInfo>;
}
Expand description

Extension methods for WidgetInfo.

Required Methods§

source

fn is_submenu(&self) -> bool

If this widget is a SubMenu! instance.

source

fn is_submenu_open(&self) -> Option<ReadOnlyVar<bool, ArcVar<bool>>>

Gets a variable that tracks if the sub-menu is open.

source

fn submenu_parent(&self) -> Option<WidgetInfo>

Gets the sub-menu that spawned self if is_submenu, otherwise returns the first ancestor that is sub-menu.

Note that the returned widget may not be an actual parent in the info-tree as sub-menus use popups to present their sub-menus.

source

fn submenu_ancestors(&self) -> SubMenuAncestors

Gets an iterator over sub-menu parents until root.

source

fn submenu_self_and_ancestors(&self) -> SubMenuAncestors

Gets an iterator over the widget, if it is a sub-menu, and sub-menu parents until root.

source

fn submenu_root(&self) -> Option<WidgetInfo>

Gets the last submenu ancestor.

source

fn menu(&self) -> Option<WidgetInfo>

Gets the alt-scope parent of the root_submenu.

This is None if the widget is inside a context menu or not inside.

Implementors§