Skip to main content

OverlayEntry

Struct OverlayEntry 

Source
pub struct OverlayEntry {
    pub key: OverlayKey,
    pub band: OverlayBand,
    pub input: OverlayInput,
    pub outside_tap: OutsideTap,
    pub window_rect: Rect,
    pub pod: OverlayPod,
    pub insets: WindowInsets,
}
Expand description

One floated surface, registered by its owner for the paint pass in progress.

Every field is a D7 rule the root reads back: band and registration order decide paint and hit order, input decides whether the surface is hit-tested at all, outside_tap decides what a press elsewhere delivers, and window_rect is both where the pod is painted and what the root hit-tests.

Fields§

§key: OverlayKey

The owner’s identity, quoted back on every routed InputEvent::Overlay so the owner recognises its own surface’s input and every other widget ignores it.

§band: OverlayBand

Which z-band the surface paints and hit-tests in (Floating below Tooltip).

§input: OverlayInput

Whether the surface takes pointer input or is painted through.

§outside_tap: OutsideTap

What a primary press outside every registered rect delivers here.

§window_rect: Rect

Where the surface sits, in absolute logical window space — the one coordinate space both the root’s paint origin and the root’s hit test use. An owner computes it in paint from PaintCtx::origin, the only absolute anchor a widget has, which is what makes an anchored surface follow its owner with no subscription of any kind.

§pod: OverlayPod

The pod the root paints. The owner holds the other clone and lays this out itself, against the window size; the owner must not paint it — painting it as well would draw the surface twice, once clipped in place and once floated.

The root paints it with window_rect.origin() as the absolute origin, and ChildPod::paint_child then adds the pod’s own origin on top as it does for any child — so leave that at Point::ZERO unless you mean an offset the hit test will not know about (routing tests window_rect alone).

§insets: WindowInsets

The window insets the pod was laid out under (its owner’s LayoutCtx view); paint installs the same value so paint-time reads agree with layout-time reads.

Trait Implementations§

Source§

impl Clone for OverlayEntry

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OverlayEntry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Prints every routing field and elides the pod: a ChildPod is not Debug, and what a diagnostic wants from an entry is where it sits and how it routes, not what it contains.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> StorageAccess<T> for T

Source§

fn as_borrowed(&self) -> &T

Borrows the value.
Source§

fn into_taken(self) -> T

Takes the value.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.