Lines
100 %
Functions
Branches
//! Inherent intent handling for `ListTab`.
//!
//! `ListTab` already carries the title-aware inherent `draw(frame, area, title)`
//! in `tabs::list`; this block adds its `handle` so `View`'s List arm can
//! dispatch directly with no trait indirection.
use crate::event::Intent;
use crate::tabs::list::ListTab;
use crate::view::Handled;
impl ListTab {
pub fn handle(&mut self, intent: Intent) -> Handled {
match intent {
Intent::ListSelectNext => {
self.select_next();
Handled::Consumed(vec![])
}
Intent::ListSelectPrev => {
self.select_prev();
Intent::ListSelectFirst => {
self.select_first();
Intent::ListSelectRow(index) => {
self.select_row(index);
Intent::ListSelectLast => {
self.select_last();
Intent::ListViewDown => {
self.select_view(true);
Intent::ListViewUp => {
self.select_view(false);
_ => Handled::Ignored,