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>
impl<'a> WidgetTreeView<'a>
Sourcepub fn bounds(&self, id: WidgetId) -> Rect
pub fn bounds(&self, id: WidgetId) -> Rect
Logical-pixel bounds of id after the most recent layout pass.
Returns Rect::ZERO for unknown ids.
Sourcepub fn is_gesture_dead_zone(&self, id: WidgetId) -> bool
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.
Sourcepub fn is_active(&self, id: WidgetId) -> bool
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.
Sourcepub fn overlay_rects(&self) -> &[Rect]
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.