1
//! Inherent intent handling for `ListTab`.
2
//!
3
//! `ListTab` already carries the title-aware inherent `draw(frame, area, title)`
4
//! in `tabs::list`; this block adds its `handle` so `ViewMut`'s List arm can
5
//! dispatch directly with no trait indirection.
6

            
7
use crate::event::Intent;
8
use crate::tabs::list::ListTab;
9
use crate::view::{DrawCtx, Handled};
10

            
11
impl ListTab {
12
15
    pub fn handle(&mut self, intent: Intent, _ctx: &DrawCtx) -> Handled {
13
15
        match intent {
14
            Intent::ListSelectNext => {
15
2
                self.select_next();
16
2
                Handled::Consumed(vec![])
17
            }
18
            Intent::ListSelectPrev => {
19
                self.select_prev();
20
                Handled::Consumed(vec![])
21
            }
22
13
            _ => Handled::Ignored,
23
        }
24
15
    }
25
}