Skip to content

Commit

Permalink
Merge pull request #26 from wiseman/use_tab_to_change_tabs
Browse files Browse the repository at this point in the history
Use TAB key to change tabs in radar.
  • Loading branch information
wcampbell0x2a authored Nov 1, 2021
2 parents 5e82731 + 2c848c3 commit 7990a44
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions apps/src/radar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,16 @@ enum Tab {
Airplanes = 2,
}

impl Tab {
pub fn next_tab(&self) -> Tab {
match self {
Tab::Map => Tab::Coverage,
Tab::Coverage => Tab::Airplanes,
Tab::Airplanes => Tab::Map,
}
}
}

fn main() {
let opts = Opts::parse();
let original_local_lat = opts.lat;
Expand Down Expand Up @@ -346,6 +356,7 @@ fn main() {
(KeyCode::F(1), _) => tab_selection = Tab::Map,
(KeyCode::F(2), _) => tab_selection = Tab::Coverage,
(KeyCode::F(3), _) => tab_selection = Tab::Airplanes,
(KeyCode::Tab, _) => tab_selection = tab_selection.next_tab(),
(KeyCode::Char('q'), _) => quit = true,
(KeyCode::Char('-'), Tab::Map | Tab::Coverage) => scale += 0.1,
(KeyCode::Char('+'), Tab::Map | Tab::Coverage) => {
Expand Down

0 comments on commit 7990a44

Please sign in to comment.