Skip to main content

WidgetTreeView

Struct WidgetTreeView 

Source
pub struct WidgetTreeView<'a> { /* private fields */ }
Expand description

Read-only view of the widget tree’s geometry passed to Widget::after_paint. Wraps a borrow of the arena so a parent widget can read the layout-resolved bounds of any descendant (typically by ids it memoised during build) once their paint pass has committed.

The view exposes only immutable queries; constructing one is crate-internal so the contract stays narrow.

Implementations§

Source§

impl<'a> WidgetTreeView<'a>

Source

pub fn bounds(&self, id: WidgetId) -> Rect

Logical-pixel bounds of id after the most recent layout pass. Returns Rect::ZERO for unknown ids.

Source

pub fn children(&self, id: WidgetId) -> &[WidgetId]

Direct arena children of id, in order.

Source

pub fn is_gesture_dead_zone(&self, id: WidgetId) -> bool

Whether id is a gesture dead-zone boundary — see WidgetNode::gesture_dead_zone and the DeadZone wrapper widget. Lets a parent classify its own subtree from after_paint: TitleBar uses it to carve interactive controls out of the OS caption region it publishes.

Source

pub fn is_active(&self, id: WidgetId) -> bool

Whether id is active — i.e. not parked dormant by a Switcher or a visible_when gate. A dormant node’s bounds are stale, so callers walking a subtree must skip it.

Source

pub fn overlay_rects(&self) -> &[Rect]

Screen rects of every overlay that is interactive this frame — open and not fading out, the predicate the overlay manager’s own pointer routing uses. Overlay content floats above the widget that anchors it, so an aggregator publishing geometry to the OS must treat these rects as covering its own: TitleBar subtracts them from the caption it publishes, or a revealed hamburger MenuBar (any overlay over the title bar) would hit-test as HTCAPTION on Windows and the OS would swallow its clicks as a window drag.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for WidgetTreeView<'a>

§

impl<'a> !Send for WidgetTreeView<'a>

§

impl<'a> !Sync for WidgetTreeView<'a>

§

impl<'a> !UnwindSafe for WidgetTreeView<'a>

§

impl<'a> Freeze for WidgetTreeView<'a>

§

impl<'a> Unpin for WidgetTreeView<'a>

§

impl<'a> UnsafeUnpin for WidgetTreeView<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.