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, [SizeHint; 2]> { ... }
}
Draw the widget within the rect
§Example
Called when layout area changes.
The output of this is processed and cached into the area which the draw method is called with.
§Returns
- Ok: The Rect to render in
- Err: a
SizeHint used to compute the area to render in