pub enum OverlayAnchor {
Owner,
Rect(Rect),
}Expand description
The overlay-portal authoring surface: the slot a widget that floats its own surface holds, what that surface is anchored to, and the placement geometry every anchored pattern needs.
Promoted here rather than left to each design system because all three of
them had derived the same geometry independently: a design system’s popover,
menu, tooltip and context menu place a surface through place and host it
through OverlaySlot, reaching both through frust::authoring alone.
What a slot places its surface against.
Both variants resolve to a window-space rect in the owner’s paint,
where the owner’s absolute origin is finally known; nothing is subscribed to
and nothing is cached across frames, so an anchor follows its owner across
scroll, relayout and animation for free.
Variants§
Owner
The owner’s own bounds — a trigger floating a menu under itself.
Rect(Rect)
A rect in the owner’s local space: a caret, a selection’s bounding
box, a press point, one row of a list. Translated by the owner’s paint
origin, so a caller states it in the same coordinates its layout and
event already speak.
Trait Implementations§
Source§impl Clone for OverlayAnchor
impl Clone for OverlayAnchor
Source§fn clone(&self) -> OverlayAnchor
fn clone(&self) -> OverlayAnchor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for OverlayAnchor
Source§impl Debug for OverlayAnchor
impl Debug for OverlayAnchor
Source§impl Default for OverlayAnchor
impl Default for OverlayAnchor
Source§fn default() -> OverlayAnchor
fn default() -> OverlayAnchor
Source§impl PartialEq for OverlayAnchor
impl PartialEq for OverlayAnchor
impl StructuralPartialEq for OverlayAnchor
Auto Trait Implementations§
impl Freeze for OverlayAnchor
impl RefUnwindSafe for OverlayAnchor
impl Send for OverlayAnchor
impl Sync for OverlayAnchor
impl Unpin for OverlayAnchor
impl UnsafeUnpin for OverlayAnchor
impl UnwindSafe for OverlayAnchor
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
impl<T> Brush for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.