pub struct AnchoredProps {
pub layout: LayoutStyle,
pub outer_margin: Edges,
pub anchor: Rect,
pub anchor_element: Option<u64>,
pub side: Side,
pub align: Align,
pub side_offset: Px,
pub options: AnchoredPanelOptions,
pub layout_out: Option<Model<AnchoredPanelLayout>>,
}Expand description
Layout-driven anchored placement wrapper for declarative element subtrees (ADR 0103).
This wrapper computes a placement transform during layout (based on the child’s intrinsic
size) and applies it via the retained runtime’s Widget::render_transform hook.
Unlike VisualTransformProps, this affects hit-testing and pointer coordinate mapping.
Fields§
§layout: LayoutStyle§outer_margin: EdgesInsets applied to the wrapper bounds before placement.
anchor: RectAnchor rect in the same coordinate space as the wrapper bounds.
anchor_element: Option<u64>Optional anchor element ID to resolve during layout (ADR 0103).
When set, the layout pass attempts to resolve the element’s current-frame bounds and uses
that rect as the anchor. This avoids cross-frame geometry jitter from
bounds_for_element(...) / last_bounds_for_element(...) queries and better matches GPUI’s
layout-driven placement model.
If the element cannot be resolved (e.g. not mounted yet), anchor is used as a fallback.
side: Side§align: Align§side_offset: PxGap between the anchor and the placed subtree.
options: AnchoredPanelOptions§layout_out: Option<Model<AnchoredPanelLayout>>Optional output model updated with the computed layout during layout.
Trait Implementations§
Source§impl Clone for AnchoredProps
impl Clone for AnchoredProps
Source§fn clone(&self) -> AnchoredProps
fn clone(&self) -> AnchoredProps
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more