Trait zng_wgt_menu::sub::SubMenuWidgetInfoExt

source ·
pub trait SubMenuWidgetInfoExt {
    // Required methods
    fn is_submenu(&self) -> bool;
    fn is_submenu_open(&self) -> Option<ReadOnlyArcVar<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<ReadOnlyArcVar<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.

Implementations on Foreign Types§

source§

impl SubMenuWidgetInfoExt for WidgetInfo

Implementors§