Lines
100 %
Functions
Branches
//! The scroll intents of the report table and the read-only overlays, applied to their window.
use tvui::RowWindow;
use crate::event::Intent;
/// Scrolls `window` by the intent; other intents are not scrolling.
#[must_use]
pub fn apply(window: &RowWindow, intent: Intent) -> bool {
match intent {
Intent::ScrollLineUp => window.scroll_up(1),
Intent::ScrollLineDown => window.scroll_down(1),
Intent::ScrollPageUp => window.page_up(),
Intent::ScrollPageDown => window.page_down(),
Intent::ScrollTop => window.to_start(),
Intent::ScrollEnd => window.to_end(),
_ => return false,
}
true
#[cfg(test)]
mod tests;