Clean plugins

This commit is contained in:
2026-02-21 01:27:32 +01:00
parent e9bca2548c
commit 77d5235d92
12 changed files with 284 additions and 167 deletions

View File

@@ -169,7 +169,7 @@ pub(super) fn handle_engine_page(ctx: &mut InputContext, key: KeyEvent) -> Input
KeyCode::Char('?') => {
ctx.dispatch(AppCommand::OpenModal(Modal::KeybindingsHelp { scroll: 0 }));
}
KeyCode::Char(' ') => {
KeyCode::Char(' ') if !ctx.app.plugin_mode => {
ctx.dispatch(AppCommand::TogglePlaying);
ctx.playing
.store(ctx.app.playback.playing, Ordering::Relaxed);

View File

@@ -77,7 +77,7 @@ pub(super) fn handle_help_page(ctx: &mut InputContext, key: KeyEvent) -> InputRe
KeyCode::Char('?') => {
ctx.dispatch(AppCommand::OpenModal(Modal::KeybindingsHelp { scroll: 0 }));
}
KeyCode::Char(' ') => {
KeyCode::Char(' ') if !ctx.app.plugin_mode => {
ctx.dispatch(AppCommand::TogglePlaying);
ctx.playing
.store(ctx.app.playback.playing, Ordering::Relaxed);
@@ -247,7 +247,7 @@ pub(super) fn handle_dict_page(ctx: &mut InputContext, key: KeyEvent) -> InputRe
KeyCode::Char('?') => {
ctx.dispatch(AppCommand::OpenModal(Modal::KeybindingsHelp { scroll: 0 }));
}
KeyCode::Char(' ') => {
KeyCode::Char(' ') if !ctx.app.plugin_mode => {
ctx.dispatch(AppCommand::TogglePlaying);
ctx.playing
.store(ctx.app.playback.playing, Ordering::Relaxed);

View File

@@ -29,7 +29,7 @@ pub(super) fn handle_main_page(ctx: &mut InputContext, key: KeyEvent, ctrl: bool
selected: false,
}));
}
KeyCode::Char(' ') => {
KeyCode::Char(' ') if !ctx.app.plugin_mode => {
ctx.dispatch(AppCommand::TogglePlaying);
ctx.playing
.store(ctx.app.playback.playing, Ordering::Relaxed);
@@ -103,9 +103,11 @@ pub(super) fn handle_main_page(ctx: &mut InputContext, key: KeyEvent, ctrl: bool
}
KeyCode::Char('h') if ctrl => ctx.dispatch(AppCommand::HardenSteps),
KeyCode::Char('l') => super::open_load(ctx),
KeyCode::Char('+') | KeyCode::Char('=') => ctx.dispatch(AppCommand::TempoUp),
KeyCode::Char('-') => ctx.dispatch(AppCommand::TempoDown),
KeyCode::Char('T') => {
KeyCode::Char('+') | KeyCode::Char('=') if !ctx.app.plugin_mode => {
ctx.dispatch(AppCommand::TempoUp);
}
KeyCode::Char('-') if !ctx.app.plugin_mode => ctx.dispatch(AppCommand::TempoDown),
KeyCode::Char('T') if !ctx.app.plugin_mode => {
let current = format!("{:.1}", ctx.link.tempo());
ctx.dispatch(AppCommand::OpenModal(Modal::SetTempo(current)));
}

View File

@@ -677,7 +677,7 @@ fn handle_options_click(ctx: &mut InputContext, col: u16, row: u16, area: Rect)
let focus = ctx.app.options.focus;
let plugin_mode = ctx.app.plugin_mode;
let focus_line = focus.line_index(plugin_mode);
let total_lines = if plugin_mode { 43 } else { 40 };
let total_lines = crate::state::options::total_lines(plugin_mode);
let max_visible = padded.height as usize;
let scroll_offset = if total_lines <= max_visible {

View File

@@ -210,7 +210,7 @@ pub(super) fn handle_options_page(ctx: &mut InputContext, key: KeyEvent) -> Inpu
KeyCode::Left | KeyCode::Right => {
cycle_option_value(ctx, key.code == KeyCode::Right);
}
KeyCode::Char(' ') => {
KeyCode::Char(' ') if !ctx.app.plugin_mode => {
ctx.dispatch(AppCommand::TogglePlaying);
ctx.playing
.store(ctx.app.playback.playing, Ordering::Relaxed);

View File

@@ -84,7 +84,7 @@ pub(super) fn handle_patterns_page(ctx: &mut InputContext, key: KeyEvent) -> Inp
}
}
}
KeyCode::Char(' ') => {
KeyCode::Char(' ') if !ctx.app.plugin_mode => {
ctx.dispatch(AppCommand::TogglePlaying);
ctx.playing
.store(ctx.app.playback.playing, Ordering::Relaxed);