diff options
Diffstat (limited to 'src/tuice/component.rs')
-rw-r--r-- | src/tuice/component.rs | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/tuice/component.rs b/src/tuice/component.rs index 753f36ba..d479a188 100644 --- a/src/tuice/component.rs +++ b/src/tuice/component.rs @@ -7,19 +7,18 @@ pub use widget::*; pub mod properties; pub use properties::*; -use enum_dispatch::enum_dispatch; use tui::{layout::Rect, Frame}; use super::{Bounds, DrawContext, Event, LayoutNode, Size, Status}; /// A component displays information and can be interacted with. #[allow(unused_variables)] -#[enum_dispatch] -pub trait TmpComponent<Message> { +pub trait Component<Message, Backend> +where + Backend: tui::backend::Backend, +{ /// Draws the component. - fn draw<Backend>(&mut self, context: DrawContext<'_>, frame: &mut Frame<'_, Backend>) - where - Backend: tui::backend::Backend; + fn draw(&mut self, context: DrawContext<'_>, frame: &mut Frame<'_, Backend>); /// How a component should react to an [`Event`]. /// |