mirror of
https://codeberg.org/unspeaker/tek.git
synced 2026-02-01 16:46:41 +01:00
wip: refactor pt.19: 22 errors
This commit is contained in:
parent
2be2c8aca2
commit
914c2d6c09
12 changed files with 78 additions and 61 deletions
|
|
@ -55,15 +55,19 @@ where
|
|||
{
|
||||
type Engine = Tui;
|
||||
fn content (&self) -> impl Widget<Engine = Tui> {
|
||||
let menus = self.menu_bar.as_ref().map_or_else(
|
||||
||&[] as &[Menu<_, _, _>],
|
||||
|m|m.menus.as_slice()
|
||||
);
|
||||
Split::down(
|
||||
if self.menu_bar.is_some() { 1 } else { 0 },
|
||||
row!(menu in self.menu_bar.menus.iter() => {
|
||||
row!(menu in menus.iter() => {
|
||||
row!(" ", menu.title.as_str(), " ")
|
||||
}),
|
||||
Split::up(
|
||||
if self.status_bar.is_some() { 1 } else { 0 },
|
||||
widget(&self.status_bar),
|
||||
self.ui
|
||||
widget(&self.ui)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -336,10 +336,18 @@ pub(crate) fn keys_vert () -> Buffer {
|
|||
cell.set_fg(Color::White);
|
||||
cell.set_bg(Color::White);
|
||||
},
|
||||
2 => if y % 6 == 0 { cell.set_char('C'); },
|
||||
3 => if y % 6 == 0 { cell.set_symbol(NTH_OCTAVE[(y / 6) as usize]); },
|
||||
2 => if y % 6 == 0 {
|
||||
cell.set_char('C');
|
||||
},
|
||||
3 => if y % 6 == 0 {
|
||||
cell.set_symbol(NTH_OCTAVE[(y / 6) as usize]);
|
||||
},
|
||||
_ => {}
|
||||
}
|
||||
});
|
||||
buffer
|
||||
}
|
||||
|
||||
const NTH_OCTAVE: [&'static str; 11] = [
|
||||
"-2", "-1", "0", "1", "2", "3", "4", "5", "6", "7", "8",
|
||||
];
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
use crate::*;
|
||||
use std::cmp::PartialEq;
|
||||
|
||||
/// Root level object for standalone `tek_sequencer`
|
||||
/// Root level object for standalone `tek_sequencer`.
|
||||
/// Also embeddable, in which case the `player` is used for preview.
|
||||
pub struct SequencerView<E: Engine> {
|
||||
/// Controls the JACK transport.
|
||||
pub transport: TransportView<E>,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue