pub struct WidgetPod { /* private fields */ }Expand description
Standard retained-widget adapter used by the SUI runtime.
WidgetPod gives a Widget stable identity, cached layout state, event
routing participation, and scene/semantics cooperation. It is the default
local retained model, but a widget’s own internals may still use custom
state, virtualization, worker threads, or remote systems before rejoining
SUI through widget contexts and scene output.
Implementations§
Source§impl WidgetPod
impl WidgetPod
pub fn new<W>(widget: W) -> Selfwhere
W: Widget + 'static,
pub const fn id(&self) -> WidgetId
pub fn debug_name(&self) -> &'static str
pub fn diagnostics_snapshot(&self) -> WidgetDiagnosticsSnapshot
pub fn collect_diagnostics(&self, output: &mut Vec<WidgetDiagnosticsSnapshot>)
pub const fn bounds(&self) -> Rect
pub const fn measured_size(&self) -> Size
pub fn set_bounds(&mut self, bounds: Rect)
pub fn measure( &mut self, parent_ctx: &mut MeasureCtx, constraints: Constraints, ) -> Size
pub fn intrinsic_size( &mut self, parent_ctx: &mut MeasureCtx, axis: Axis, available_cross: f32, ) -> IntrinsicSize
pub fn arrange(&mut self, parent_ctx: &mut ArrangeCtx, bounds: Rect)
pub fn paint(&self, parent_ctx: &mut PaintCtx)
pub fn semantics(&self, parent_ctx: &mut SemanticsCtx)
Sourcepub fn accepts_focus(&self) -> bool
pub fn accepts_focus(&self) -> bool
Return whether this retained widget is a focus target.
Adaptive containers use this while selecting a restoration fallback for a subtree that has just become visible again.
Sourcepub fn visit_children(&self, visitor: &mut dyn WidgetPodVisitor)
pub fn visit_children(&self, visitor: &mut dyn WidgetPodVisitor)
Visit this pod’s direct children. Public so container widgets can walk their own subtree (e.g. to derive a focus-within visual by comparing descendant ids against the focused widget id — sui has no focus-within event, and any focus change repaints every window, so polling at paint time stays correct).