This commit is contained in:
@@ -267,7 +267,8 @@ pub(super) fn handle_engine_page(ctx: &mut InputContext, key: KeyEvent) -> Input
|
||||
}
|
||||
KeyCode::Char('A') if ctx.app.audio.section == EngineSection::Samples => {
|
||||
use crate::state::file_browser::FileBrowserState;
|
||||
let state = FileBrowserState::new_load(String::new());
|
||||
let mut state = FileBrowserState::new_load(String::new());
|
||||
state.compute_audio_counts();
|
||||
ctx.dispatch(AppCommand::OpenModal(Modal::AddSamplePath(Box::new(state))));
|
||||
}
|
||||
KeyCode::Char('D') => {
|
||||
|
||||
@@ -249,8 +249,12 @@ pub(super) fn handle_modal_input(ctx: &mut InputContext, key: KeyEvent) -> Input
|
||||
Some(state.current_dir().join(&entry.name))
|
||||
} else if entry.is_dir {
|
||||
state.enter_selected();
|
||||
state.compute_audio_counts();
|
||||
None
|
||||
} else {
|
||||
ctx.dispatch(AppCommand::SetStatus(
|
||||
"Select a directory, not a file".into(),
|
||||
));
|
||||
None
|
||||
}
|
||||
} else {
|
||||
@@ -288,15 +292,16 @@ pub(super) fn handle_modal_input(ctx: &mut InputContext, key: KeyEvent) -> Input
|
||||
}
|
||||
}
|
||||
KeyCode::Esc => ctx.dispatch(AppCommand::CloseModal),
|
||||
KeyCode::Tab => state.autocomplete(),
|
||||
KeyCode::Left => state.go_up(),
|
||||
KeyCode::Right => state.enter_selected(),
|
||||
KeyCode::Up => state.select_prev(14),
|
||||
KeyCode::Down => state.select_next(14),
|
||||
KeyCode::Backspace => state.backspace(),
|
||||
KeyCode::Tab => { state.autocomplete(); state.compute_audio_counts(); }
|
||||
KeyCode::Left => { state.go_up(); state.compute_audio_counts(); }
|
||||
KeyCode::Right => { state.enter_selected(); state.compute_audio_counts(); }
|
||||
KeyCode::Up => state.select_prev(16),
|
||||
KeyCode::Down => state.select_next(16),
|
||||
KeyCode::Backspace => { state.backspace(); state.compute_audio_counts(); }
|
||||
KeyCode::Char(c) => {
|
||||
state.input.push(c);
|
||||
state.refresh_entries();
|
||||
state.compute_audio_counts();
|
||||
}
|
||||
_ => {}
|
||||
},
|
||||
|
||||
@@ -983,7 +983,8 @@ fn handle_modal_click(ctx: &mut InputContext, col: u16, row: u16, term: Rect) {
|
||||
Modal::PatternProps { .. } => (50, 18),
|
||||
Modal::EuclideanDistribution { .. } => (50, 11),
|
||||
Modal::Onboarding { .. } => (57, 20),
|
||||
Modal::FileBrowser(_) | Modal::AddSamplePath(_) => (60, 18),
|
||||
Modal::FileBrowser(_) => (60, 18),
|
||||
Modal::AddSamplePath(_) => (70, 20),
|
||||
Modal::Rename { .. } => (40, 5),
|
||||
Modal::SetPattern { .. } | Modal::SetScript { .. } => (45, 5),
|
||||
Modal::SetTempo(_) => (30, 5),
|
||||
|
||||
Reference in New Issue
Block a user