pub struct RectReader { /* private fields */ }Expand description
Fires atom.set(Some(ctx.rect)) after paint, surfacing the widget’s
window-pixel coordinates to user code without any widget modification.
ⓘ
let anchor: Atom<Option<Rect>> = ctx.state(None);
RectReader::new(anchor.clone(), Button::new("Open"))
// After first paint: anchor.get() == Some(Rect { ... })Implementations§
Trait Implementations§
Source§impl Widget for RectReader
impl Widget for RectReader
Source§fn children(&self) -> Children<'_>
fn children(&self) -> Children<'_>
Declare this widget’s children. Drives every default below.
Source§fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
fn layout(&self, ctx: &LayoutCtx<'_>) -> Size
Measure under
ctx.constraints and return a size within them. Read moreSource§fn flex_factor(&self) -> f32
fn flex_factor(&self) -> f32
Flex weight inside Row/Column. Wrappers are transparent by default.
Auto Trait Implementations§
impl !RefUnwindSafe for RectReader
impl !UnwindSafe for RectReader
impl Freeze for RectReader
impl Send for RectReader
impl Sync for RectReader
impl Unpin for RectReader
impl UnsafeUnpin for RectReader
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<W> FocusApi for W
impl<W> FocusApi for W
Source§fn focus_node(self, node: FocusNode) -> WithFocus<Self>
fn focus_node(self, node: FocusNode) -> WithFocus<Self>
Attach a focus node. This enables focus-ring rendering and explicit
neighbor wiring.