switch toolbar actions; bold borders and titles

This commit is contained in:
🪞👃🪞 2024-05-29 13:34:36 +03:00
parent 7dd5f7f488
commit 31f8ec5362
8 changed files with 103 additions and 116 deletions

View file

@ -1,12 +1,10 @@
use crate::prelude::*;
use super::Sequencer;
fn handle (
state: &mut Sequencer,
event: crossterm::event::Event
) -> Result<(), Box<dyn Error>> {
use crossterm::event::{Event, KeyCode, KeyModifiers};
pub fn handle (state: &mut Sequencer,event: &Event) -> Result<(), Box<dyn Error>> {
if let Event::Key(event) = event {
match event.code {
KeyCode::Char('c') => {
if event.modifiers == KeyModifiers::CONTROL {
@ -14,12 +12,12 @@ fn handle (
}
},
KeyCode::Char('[') => {
if state.duration > 0 {
state.duration = state.duration - 1
if state.cursor.2 > 0 {
state.cursor.2 = state.cursor.2 - 1
}
},
KeyCode::Char(']') => {
state.duration = state.duration + 1
state.cursor.2 = state.cursor.2 + 1
},
KeyCode::Down => {
state.cursor.1 = if state.cursor.1 >= 3 {
@ -49,10 +47,13 @@ fn handle (
state.cursor.0 + 1
}
},
KeyCode::Char('A') => {
},
_ => {
println!("{event:?}");
}
}
}
Ok(())
}