docs: PaintUi::measure in contract-api

This commit is contained in:
aiongg
2026-11-13 19:26:50 +00:00
parent f04b5867fa
commit 5b3749e34a
+1
View File
@@ -2217,6 +2217,7 @@ The component traits, context types, `PaintUi`, `Looks`, the pipeline and its st
- `pub fn clipped<R>(&mut self, rect: Rect, paint: impl FnOnce(&mut Self) -> R) -> R`. Runs `paint` with this `PaintUi` cut to `rect` (inside the clip already in force), as `Draw::clipped` does for a
- `pub fn with_style<R>(&self, variant: Variant, f: impl FnOnce(&StyleCx<'_>) -> R) -> R`. Runs `f` with the style context of this component's env, so app hooks called from `paint` pick colours and
- `pub fn child<C: Show>(&mut self, key: impl Hash + Debug, rect: Rect, child: C) -> C::Output`. Shows a child component at a physical rect, with id `cx.key(key)`. The child `Ui` is pinned left to
- `pub fn measure<C: Show>(&self, key: impl Hash + Debug, child: &mut C, proposal: craft_behavior::Proposal) -> egui::Vec2`. Measures a child under the composite's resolved `enabled` and `size`, as [`child`](Self::child) with the same key will show it: for a composite that places its children by their size.
- `pub fn inner<C: Show>(&mut self, key: impl Hash + Debug, rect: Rect, child: C) -> C::Output`. Shows `child` as the owner's own control, such as a picker the owner draws its field with. The child's node
- `pub fn child_with_tip<C: Show>(&mut self, key: impl Hash + Debug, rect: Rect, child: C, tip: impl FnOnce(&mut Ui)) -> C::Output`. Shows a child with rich tooltip content.
- `pub fn labelled<C: Show>(&mut self, key: impl Hash + Debug, rect: Rect, label: Label, side: SideLabel, child: C) -> C::Output`. Runs the label step (B2) for one leaf child at `rect`: the label's placement beside or above the child, the