Hook up TreeView to Chat
This commit is contained in:
parent
14125c1650
commit
e72fd60d16
2 changed files with 55 additions and 7 deletions
37
cove-tui/src/chat/tree.rs
Normal file
37
cove-tui/src/chat/tree.rs
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
use crossterm::event::KeyEvent;
|
||||
use crossterm::style::ContentStyle;
|
||||
use toss::frame::{Frame, Pos, Size};
|
||||
|
||||
use crate::traits::{Msg, MsgStore};
|
||||
|
||||
pub struct TreeView {}
|
||||
|
||||
impl TreeView {
|
||||
pub fn new() -> Self {
|
||||
Self {}
|
||||
}
|
||||
|
||||
pub fn handle_key_event<M, S>(
|
||||
&mut self,
|
||||
store: &mut S,
|
||||
cursor: &mut Option<M::Id>,
|
||||
event: KeyEvent,
|
||||
size: Size,
|
||||
) where
|
||||
M: Msg,
|
||||
S: MsgStore<M>,
|
||||
{
|
||||
// TODO
|
||||
}
|
||||
|
||||
pub fn render<M: Msg, S: MsgStore<M>>(
|
||||
&mut self,
|
||||
store: &mut S,
|
||||
frame: &mut Frame,
|
||||
pos: Pos,
|
||||
size: Size,
|
||||
) {
|
||||
// TODO
|
||||
frame.write(Pos::new(0, 0), "Hello world!", ContentStyle::default());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue