use crate::file_manager::FileInfo;
#[derive(Clone)]
pub enum Overlay {
ShowInfo { info: FileInfo },
}
pub struct OverlayStack {
overlays: Vec<Overlay>,
}
impl OverlayStack {
pub fn new() -> Self {
Self {
overlays: Vec::new(),
}
}
pub fn push(&mut self, overlay: Overlay) {
self.overlays.push(overlay);
}
pub fn pop(&mut self) -> Option<Overlay> {
self.overlays.pop()
}
pub fn top(&self) -> Option<&Overlay> {
self.overlays.last()
}
}
impl Default for OverlayStack {
fn default() -> Self {
Self::new()
}
}