Skip to main content

LayoutItem

Trait LayoutItem 

Source
pub trait LayoutItem: Component {
    // Required method
    fn layout_node(&self) -> NodeId;

    // Provided method
    fn pointer_opaque(&self) -> bool { ... }
}

Required Methods§

Provided Methods§

Source

fn pointer_opaque(&self) -> bool

Whether this widget stands in front of whatever its siblings drew underneath it, for a pointer event its parent is hit-testing.

True for anything that occupies its box, which is everything that draws: the topmost child under the pointer takes the event whether or not it wants it, exactly as a browser hit-tests — otherwise a floating panel lets the wheel through to the pane it covers. The one thing that is not there for this purpose is an Overlay: the registry routes positioned events to it before the tree walk, so its in-tree node must not shadow the siblings it was portaled away from.

Trait Implementations§

Source§

impl Component for Box<dyn LayoutItem>

Source§

fn view(&self) -> RenderNode

Source§

fn on_event(&mut self, event: &Event) -> EventResult

Source§

fn debug_name(&self) -> &'static str

Human-readable widget type name for the devtools tree inspector.
Source§

impl LayoutItem for Box<dyn LayoutItem>

Source§

fn layout_node(&self) -> NodeId

Source§

fn pointer_opaque(&self) -> bool

Whether this widget stands in front of whatever its siblings drew underneath it, for a pointer event its parent is hit-testing. Read more

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl LayoutItem for Box<dyn LayoutItem>

Implementors§