pub struct ScreenStack { /* private fields */ }Expand description
Manages a stack of overlay layers with auto z-indexing.
Overlays are rendered in insertion order. Each overlay receives a unique z-index spaced 10 apart from the base. Dim layers are inserted one z-level below overlays that request background dimming.
Implementations§
Source§impl ScreenStack
impl ScreenStack
Sourcepub fn push(
&mut self,
config: OverlayConfig,
lines: Vec<Vec<Segment>>,
) -> OverlayId
pub fn push( &mut self, config: OverlayConfig, lines: Vec<Vec<Segment>>, ) -> OverlayId
Pushes an overlay onto the stack.
Returns a unique OverlayId for later removal.
Sourcepub fn remove(&mut self, id: OverlayId) -> bool
pub fn remove(&mut self, id: OverlayId) -> bool
Removes a specific overlay by ID.
Returns true if the overlay was found and removed.
Sourcepub fn resolve_position(
position: &OverlayPosition,
size: Size,
screen: Size,
) -> Position
pub fn resolve_position( position: &OverlayPosition, size: Size, screen: Size, ) -> Position
Resolves an overlay position to absolute screen coordinates.
Sourcepub fn apply_to_compositor(&self, compositor: &mut Compositor, screen: Size)
pub fn apply_to_compositor(&self, compositor: &mut Compositor, screen: Size)
Applies all overlays as layers to a compositor.
Each overlay is added with its resolved position and z-index.
Overlays with dim_background get a full-screen dim layer inserted
one z-level below them.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ScreenStack
impl RefUnwindSafe for ScreenStack
impl Send for ScreenStack
impl Sync for ScreenStack
impl Unpin for ScreenStack
impl UnwindSafe for ScreenStack
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