Feat: UI / UX fixes
This commit is contained in:
@@ -14,7 +14,7 @@ use arc_swap::ArcSwap;
|
||||
use crossbeam_channel::Sender;
|
||||
use crossterm::event::{KeyCode, KeyEvent, KeyEventKind, KeyModifiers, MouseEvent};
|
||||
use ratatui::layout::Rect;
|
||||
use std::sync::atomic::{AtomicBool, AtomicI64};
|
||||
use std::sync::atomic::{AtomicBool, AtomicI64, Ordering};
|
||||
use std::sync::Arc;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
@@ -87,7 +87,7 @@ fn handle_live_keys(ctx: &mut InputContext, key: &KeyEvent) -> bool {
|
||||
match (key.code, key.kind) {
|
||||
_ if !matches!(ctx.app.ui.modal, Modal::None) => false,
|
||||
_ if ctx.app.page == Page::Script && ctx.app.script_editor.focused => false,
|
||||
(KeyCode::Char('f'), KeyEventKind::Press) => {
|
||||
(KeyCode::Char('f'), KeyEventKind::Press) if !key.modifiers.contains(KeyModifiers::ALT) => {
|
||||
ctx.dispatch(AppCommand::ToggleLiveKeysFill);
|
||||
true
|
||||
}
|
||||
@@ -97,11 +97,42 @@ fn handle_live_keys(ctx: &mut InputContext, key: &KeyEvent) -> bool {
|
||||
|
||||
fn handle_normal_input(ctx: &mut InputContext, key: KeyEvent) -> InputResult {
|
||||
let ctrl = key.modifiers.contains(KeyModifiers::CONTROL);
|
||||
let alt = key.modifiers.contains(KeyModifiers::ALT);
|
||||
if key.code == KeyCode::F(12) && !ctx.app.plugin_mode {
|
||||
if !ctx.app.playback.playing {
|
||||
ctx.dispatch(AppCommand::TogglePlaying);
|
||||
ctx.playing.store(true, Ordering::Relaxed);
|
||||
}
|
||||
let _ = ctx.seq_cmd_tx.send(SeqCommand::RestartAll);
|
||||
return InputResult::Continue;
|
||||
}
|
||||
|
||||
if ctx.app.panel.visible && ctx.app.panel.focus == PanelFocus::Side {
|
||||
return panel::handle_panel_input(ctx, key);
|
||||
}
|
||||
|
||||
if alt {
|
||||
match key.code {
|
||||
KeyCode::Up => {
|
||||
ctx.dispatch(AppCommand::PrevPattern);
|
||||
return InputResult::Continue;
|
||||
}
|
||||
KeyCode::Down => {
|
||||
ctx.dispatch(AppCommand::NextPattern);
|
||||
return InputResult::Continue;
|
||||
}
|
||||
KeyCode::Left | KeyCode::Char('b') => {
|
||||
ctx.dispatch(AppCommand::PrevBank);
|
||||
return InputResult::Continue;
|
||||
}
|
||||
KeyCode::Right | KeyCode::Char('f') => {
|
||||
ctx.dispatch(AppCommand::NextBank);
|
||||
return InputResult::Continue;
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
|
||||
if ctrl {
|
||||
let minimap_timed = MinimapMode::Timed(Instant::now() + Duration::from_millis(250));
|
||||
match key.code {
|
||||
|
||||
Reference in New Issue
Block a user