Skip to main content

Overlay

Trait Overlay 

Source
pub trait Overlay {
    type A: ActionExt;

    // Required methods
    fn handle_input(&mut self, c: char) -> OverlayEffect;
    fn draw(&mut self, frame: &mut Frame<'_>, area: Rect);

    // Provided methods
    fn on_enable(&mut self, area: &Rect) { ... }
    fn on_disable(&mut self) { ... }
    fn handle_action(&mut self, action: &Action<Self::A>) -> OverlayEffect { ... }
    fn area(&mut self, ui_area: &Rect) -> Result<Rect, [u16; 2]> { ... }
}

Required Associated Types§

Required Methods§

Source

fn handle_input(&mut self, c: char) -> OverlayEffect

Source

fn draw(&mut self, frame: &mut Frame<'_>, area: Rect)

Draw the widget within the rect

§Example

Provided Methods§

Source

fn on_enable(&mut self, area: &Rect)

Source

fn on_disable(&mut self)

Source

fn handle_action(&mut self, action: &Action<Self::A>) -> OverlayEffect

Source

fn area(&mut self, ui_area: &Rect) -> Result<Rect, [u16; 2]>

Called when layout area changes. The output of this is processed and cached into the area which the draw method is called with.

§Notes

Return None or Err([0, 0]) to draw in the default area (see OverlayConfig and default_area)

Implementors§