pub struct OverlayStack { /* private fields */ }Expand description
The stack, bottom first.
Implementations§
Source§impl OverlayStack
impl OverlayStack
pub fn new() -> Self
Sourcepub fn open(
&mut self,
spec: OverlaySpec,
focused: Option<Id>,
) -> (Opened, Vec<Closed>)
pub fn open( &mut self, spec: OverlaySpec, focused: Option<Id>, ) -> (Opened, Vec<Closed>)
Opens an overlay on top, remembering the focus to restore.
Sourcepub fn update(&mut self, spec: OverlaySpec) -> bool
pub fn update(&mut self, spec: OverlaySpec) -> bool
Replaces an open overlay’s declaration where it is (its Escape rule, its offset), closing nothing; whether it is open.
Sourcepub fn close(&mut self, id: Id) -> Vec<Closed>
pub fn close(&mut self, id: Id) -> Vec<Closed>
Closes an overlay and everything above it. Closing one that is not open closes nothing (the list is empty).
Sourcepub fn click(&mut self, hit: Option<Id>) -> Vec<Closed>
pub fn click(&mut self, hit: Option<Id>) -> Vec<Closed>
A click on hit (an overlay, or None for the interface below):
closes the dismissable overlays above it, stopping at a modal or
at one that stays.
Sourcepub fn is_blocked(&self, target: Option<Id>) -> bool
pub fn is_blocked(&self, target: Option<Id>) -> bool
Whether input to an overlay (or to the interface, None) is
blocked by a modal above it.
pub fn top(&self) -> Option<&OverlaySpec>
pub fn contains(&self, id: Id) -> bool
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn specs(&self) -> impl Iterator<Item = &OverlaySpec>
pub fn specs(&self) -> impl Iterator<Item = &OverlaySpec>
The overlays, bottom first.
Sourcepub fn set_rect(&mut self, id: Id, rect: Rect)
pub fn set_rect(&mut self, id: Id, rect: Rect)
Records where an overlay was drawn (for outside clicks).
Sourcepub fn set_anchor(&mut self, id: Id, anchor: Rect)
pub fn set_anchor(&mut self, id: Id, anchor: Rect)
Records the widget an overlay was placed next to: a press there is not outside it.
Sourcepub fn set_popups(&mut self, id: Id, layers: Vec<LayerId>)
pub fn set_popups(&mut self, id: Id, layers: Vec<LayerId>)
Records the egui layers drawn from inside an overlay (a combo box’s list, a context menu): a press on one of them is not outside it, and while one of them is open Escape goes to it.
Sourcepub fn top_popups(&self) -> &[LayerId]
pub fn top_popups(&self) -> &[LayerId]
The egui layers drawn from inside the top overlay last pass.
Trait Implementations§
Source§impl Clone for OverlayStack
impl Clone for OverlayStack
Source§fn clone(&self) -> OverlayStack
fn clone(&self) -> OverlayStack
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OverlayStack
impl Debug for OverlayStack
Source§impl Default for OverlayStack
impl Default for OverlayStack
Source§fn default() -> OverlayStack
fn default() -> OverlayStack
Auto Trait Implementations§
impl Freeze for OverlayStack
impl RefUnwindSafe for OverlayStack
impl Send for OverlayStack
impl Sync for OverlayStack
impl Unpin for OverlayStack
impl UnsafeUnpin for OverlayStack
impl UnwindSafe for OverlayStack
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more