This commit is contained in:
2026-03-05 18:24:09 +01:00
parent 4743c33916
commit 0097777449
18 changed files with 177 additions and 276 deletions

View File

@@ -3,9 +3,10 @@ use std::sync::atomic::Ordering;
use super::{InputContext, InputResult};
use crate::commands::AppCommand;
use crate::page::Page;
use crate::state::{
ConfirmAction, CyclicEnum, EuclideanField, Modal, PanelFocus, PatternField, RenameTarget,
SampleBrowserState, SidePanel,
ConfirmAction, CyclicEnum, EuclideanField, Modal, PatternField, RenameTarget,
SampleBrowserState,
};
pub(super) fn handle_main_page(ctx: &mut InputContext, key: KeyEvent, ctrl: bool) -> InputResult {
@@ -13,15 +14,11 @@ pub(super) fn handle_main_page(ctx: &mut InputContext, key: KeyEvent, ctrl: bool
match key.code {
KeyCode::Tab => {
if ctx.app.panel.visible {
ctx.app.panel.visible = false;
ctx.app.panel.focus = PanelFocus::Main;
} else {
let state = SampleBrowserState::new(&ctx.app.audio.config.sample_paths);
ctx.app.panel.side = Some(SidePanel::SampleBrowser(state));
ctx.app.panel.visible = true;
ctx.app.panel.focus = PanelFocus::Side;
if ctx.app.sample_browser.is_none() {
ctx.app.sample_browser =
Some(SampleBrowserState::new(&ctx.app.audio.config.sample_paths));
}
ctx.dispatch(AppCommand::GoToPage(Page::SampleExplorer));
}
KeyCode::Char('q') if !ctx.app.plugin_mode => {
ctx.dispatch(AppCommand::OpenModal(Modal::Confirm {