pub enum OverlayPlacement {
Below,
Above,
TrailingEdge,
AtPointer(Point),
NearAnchor {
offset: Vec2,
},
Centered,
BottomCenter,
BelowPreferred,
ViewportCorner {
corner: Corner,
margin: Vec2,
},
FullViewport,
}Expand description
How an overlay is positioned relative to its anchor.
Variants§
Below
Below the anchor, leading-edge aligned (dropdown).
Above
Above the anchor (fallback when no space below).
TrailingEdge
To the trailing side of the anchor (submenu).
AtPointer(Point)
At the pointer position (context menu).
NearAnchor
Near the anchor with a preferred alignment and offset (tooltip).
Centered
Centered within the viewport (dialog).
BottomCenter
Bottom-centered within the viewport (snackbar/toast).
BelowPreferred
Below the anchor if space allows, otherwise above (combo box dropdown).
The viewport height is supplied by position_overlays() at layout time.
ViewportCorner
Snaps content to a viewport corner with a per-axis margin
(used by ToastHost for stacked toast notifications, also
suitable for picture-in-picture, floating action overlays).
Anchor bounds are ignored. The leading/trailing axis honours
LayoutDirection: TopTrailing is top-right under LTR and
top-left under RTL.
FullViewport
Fills the entire viewport, anchor-independent. Used by the modal-presentation pipeline to mount a dialog scrim behind a centered modal panel — the scrim covers the full window so the content behind dims uniformly. Anchor bounds are ignored.
Trait Implementations§
Source§impl Clone for OverlayPlacement
impl Clone for OverlayPlacement
Source§fn clone(&self) -> OverlayPlacement
fn clone(&self) -> OverlayPlacement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more