Skip to main content

tui/view/
config.rs

1//! Inherent intent handling for `ConfigTab`.
2//!
3//! Drawing stays on the inherent `draw(frame, area)` in `tabs::config`; this
4//! block adds `handle` so `ViewMut`'s Config arm dispatches with no trait.
5
6use crate::event::Intent;
7use crate::tabs::config::ConfigTab;
8use crate::view::{DrawCtx, Handled};
9
10impl ConfigTab {
11    pub fn handle(&mut self, intent: Intent, _ctx: &DrawCtx) -> Handled {
12        match intent {
13            Intent::ListSelectNext => {
14                self.select_next();
15                Handled::Consumed(vec![])
16            }
17            Intent::ListSelectPrev => {
18                self.select_prev();
19                Handled::Consumed(vec![])
20            }
21            _ => Handled::Ignored,
22        }
23    }
24}