fix toggling of pool

This commit is contained in:
🪞👃🪞 2024-12-25 02:56:29 +01:00
parent 85cfb43e82
commit 6319c0db2d
2 changed files with 2 additions and 4 deletions

View file

@ -15,7 +15,6 @@ pub struct ArrangerTui {
pub midi_buf: Vec<Vec<Vec<u8>>>,
pub editor: PhraseEditorModel,
pub perf: PerfModel,
pub show_pool: bool,
}
impl ArrangerTui {
pub fn selected (&self) -> ArrangerSelection {
@ -80,7 +79,6 @@ from_jack!(|jack| ArrangerTui {
midi_buf: vec![vec![];65536],
note_buf: vec![],
perf: PerfModel::default(),
show_pool: false,
jack: jack.clone(),
}
});
@ -96,7 +94,7 @@ render!(<Tui>|self: ArrangerTui|{
let play = Fixed::wh(5, 2, PlayPause(self.clock.is_rolling()));
let transport = TransportView::from((self, Some(ItemPalette::from(TuiTheme::g(96))), true));
let with_transport = |x|col!([row!(![&play, &transport]), &x]);
let pool_size = if self.show_pool { self.splits[1] } else { 0 };
let pool_size = if self.phrases.visible { self.splits[1] } else { 0 };
let with_pool = |x|Split::left(false, pool_size, PoolView(&self.phrases), x);
let status = ArrangerStatus::from(self);
let with_editbar = |x|Tui::split_n(false, 3, PhraseEditStatus(&self.editor), x);

View file

@ -65,7 +65,7 @@ input_to_command!(ArrangerCommand: <Tui>|state: ArrangerTui, input|match input.e
Self::Track(ArrangerTrackCommand::Add),
// Tab: Toggle visibility of phrase pool column
key_pat!(Tab) =>
Self::Phrases(PhrasesCommand::Show(!state.show_pool)),
Self::Phrases(PhrasesCommand::Show(!state.phrases.visible)),
_ => to_arrangement_command(state, input).or_else(||{
if let Some(command) = PhraseCommand::input_to_command(&state.editor, input) {
Some(Self::Editor(command))