rendering

This commit is contained in:
Kent Overstreet 2026-04-05 23:04:10 -04:00
parent 36d698a3e1
commit 49cd6d6ab6
8 changed files with 178 additions and 157 deletions

View file

@ -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
}
}