Skip to main content

OverlayExt

Trait OverlayExt 

Source
pub trait OverlayExt:
    IsA<Overlay>
    + Sealed
    + 'static {
    // Provided methods
    fn add_overlay(&self, widget: &impl IsA<Widget>) { ... }
    fn is_overlay_pass_through(&self, widget: &impl IsA<Widget>) -> bool { ... }
    fn reorder_overlay(&self, child: &impl IsA<Widget>, index_: i32) { ... }
    fn set_overlay_pass_through(
        &self,
        widget: &impl IsA<Widget>,
        pass_through: bool,
    ) { ... }
    fn child_index<T: IsA<Widget>>(&self, item: &T) -> i32 { ... }
    fn set_child_index<T: IsA<Widget>>(&self, item: &T, index: i32) { ... }
}
Expand description

Trait containing all Overlay methods.

§Implementors

Overlay

Provided Methods§

Source

fn add_overlay(&self, widget: &impl IsA<Widget>)

Adds widget to self.

The widget will be stacked on top of the main widget added with ContainerExt::add().

The position at which widget is placed is determined from its halign and valign properties.

§widget

a Widget to be added to the container

Source

fn is_overlay_pass_through(&self, widget: &impl IsA<Widget>) -> bool

Convenience function to get the value of the pass-through child property for widget.

§widget

an overlay child of Overlay

§Returns

whether the widget is a pass through child.

Source

fn reorder_overlay(&self, child: &impl IsA<Widget>, index_: i32)

Moves child to a new index in the list of self children. The list contains overlays in the order that these were added to self by default. See also index.

A widget’s index in the self children list determines which order the children are drawn if they overlap. The first child is drawn at the bottom. It also affects the default focus chain order.

§child

the overlaid Widget to move

§index_

the new index for child in the list of overlay children of self, starting from 0. If negative, indicates the end of the list

Source

fn set_overlay_pass_through( &self, widget: &impl IsA<Widget>, pass_through: bool, )

Convenience function to set the value of the pass-through child property for widget.

§widget

an overlay child of Overlay

§pass_through

whether the child should pass the input through

Source

fn child_index<T: IsA<Widget>>(&self, item: &T) -> i32

Source

fn set_child_index<T: IsA<Widget>>(&self, item: &T, index: i32)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§