Handles downward navigation in both list and details views.
(&mut self)
| 412 | |
| 413 | /// Handles downward navigation in both list and details views. |
| 414 | fn handle_down_navigation(&mut self) { |
| 415 | match self.focused_pane { |
| 416 | FocusedPane::List => { |
| 417 | let i = self.selected.selected().unwrap_or(0); |
| 418 | if i < self.papers.len().saturating_sub(1) { |
| 419 | self.selected.select(Some(i + 1)); |
| 420 | self.needs_redraw = true; |
| 421 | } |
| 422 | }, |
| 423 | FocusedPane::Details => |
| 424 | if let Some(max) = self.max_scroll { |
| 425 | if self.scroll_position < max { |
| 426 | self.scroll_position += 1; |
| 427 | self.needs_redraw = true; |
| 428 | } |
| 429 | }, |
| 430 | } |
| 431 | } |
| 432 | |
| 433 | /// Attempts to open the selected paper's PDF with the system viewer. |
| 434 | /// |