gamechanging, commands works only on their windows properly well

This commit is contained in:
filipriec
2025-03-22 23:32:33 +01:00
parent 8da29376ab
commit 1a529a70bf
3 changed files with 51 additions and 15 deletions

View File

@@ -51,19 +51,16 @@ impl EventHandler {
) -> Result<(bool, String), Box<dyn std::error::Error>> {
if app_state.ui.show_intro {
if let Event::Key(key) = event {
match key.code {
KeyCode::Left => intro_state.previous_option(),
KeyCode::Right => intro_state.next_option(),
KeyCode::Enter => {
if intro_state.selected_option == 0 {
app_state.ui.show_intro = false;
} else {
app_state.ui.show_intro = false;
app_state.ui.show_admin = true;
}
return Ok((false, String::new()));
}
_ => {}
let action = config.get_intro_action(key.code, key.modifiers);
match action {
Some("previous_option") => intro_state.previous_option(),
Some("next_option") => intro_state.next_option(),
Some("select") => {
app_state.ui.show_intro = false;
app_state.ui.show_admin = intro_state.selected_option == 1;
},
_ => {} // Ignore all other keys
}
}
return Ok((false, String::new()));