@@ -1,15 +1,17 @@
2// IDEA: render to a cache buffer, then if not changed, copy the buf into the parent
1// IDEA: render to a cache buffer, then if not changed, copy the buf into the parent
3pub trait Component {
3pub trait Component {
4 /// Process input events, return true if handled.
4 /// Process input events, return true if handled.
5− fn process_event(&mut self, event: crossterm::event::Event, args) -> bool;
5+ fn process_event(&mut self, event: crossterm::event::Event, args: ()) -> bool;
6 /// Should redraw? Useful for saving redraw cycles if we know component didn't change.
6 /// Should redraw? Useful for saving redraw cycles if we know component didn't change.
7− fn should_update(&self) -> bool { true }
7+ fn should_update(&self) -> bool {
9 fn render(&mut self, surface: &mut Surface, args: ());
11 fn render(&mut self, surface: &mut Surface, args: ());
12−// HStack / VStack
14+// HStack / VStack
13// focus by component id: each View/Editor gets it's own incremental id at create
15// focus by component id: each View/Editor gets it's own incremental id at create
14// Component: View(Arc<State>) -> multiple views can point to same state
16// Component: View(Arc<State>) -> multiple views can point to same state
15// id 0 = prompt?
17// id 0 = prompt?