rendering
This commit is contained in:
parent
36d698a3e1
commit
49cd6d6ab6
8 changed files with 178 additions and 157 deletions
|
|
@ -38,13 +38,15 @@ impl ScreenView for UnconsciousScreen {
|
|||
fn label(&self) -> &'static str { "unconscious" }
|
||||
|
||||
fn tick(&mut self, frame: &mut Frame, area: Rect,
|
||||
key: Option<KeyEvent>, _app: &mut App) -> Option<ScreenAction> {
|
||||
if let Some(key) = key {
|
||||
match key.code {
|
||||
KeyCode::PageUp => { self.scroll = self.scroll.saturating_sub(20); }
|
||||
KeyCode::PageDown => { self.scroll += 20; }
|
||||
KeyCode::Esc => return Some(ScreenAction::Switch(0)),
|
||||
_ => {}
|
||||
events: &[ratatui::crossterm::event::Event], _app: &mut App) {
|
||||
for event in events {
|
||||
if let ratatui::crossterm::event::Event::Key(key) = event {
|
||||
if key.kind != ratatui::crossterm::event::KeyEventKind::Press { continue; }
|
||||
match key.code {
|
||||
KeyCode::PageUp => { self.scroll = self.scroll.saturating_sub(20); }
|
||||
KeyCode::PageDown => { self.scroll += 20; }
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -79,7 +81,6 @@ impl ScreenView for UnconsciousScreen {
|
|||
render_tasks(frame, &st.tasks, tasks_area);
|
||||
}
|
||||
}
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue