This commit is contained in:
🪞👃🪞 2024-06-29 15:44:50 +03:00
parent e13569df93
commit 2432f27e8c
3 changed files with 11 additions and 6 deletions

View file

@ -13,8 +13,8 @@ impl<'a> LauncherGridView<'a> {
Self { state, buf, area, separator, focused }
}
pub fn draw (&mut self) -> Usually<Rect> {
self.separator_h(0, false);
self.separator_h(2, false);
//self.separator_h(0, false);
//self.separator_h(2, false);
self.separator_h((self.state.cursor.1 * 2) as u16, true);
self.separator_h(((self.state.cursor.1 + 1) * 2) as u16, true);
draw_box_styled(self.buf, self.area, Some(

View file

@ -173,6 +173,7 @@ pub fn process (state: &mut Launcher, _: &Client, _: &ProcessScope) -> Control {
}
pub fn render (state: &Launcher, buf: &mut Buffer, area: Rect) -> Usually<Rect> {
let Rect { x, y, width, height } = area;
let width = 80;
crate::device::sequencer::draw_play_stop(buf, x + 1, y, &state.playing);
crate::device::sequencer::draw_rec(buf, x + 12, y, state.recording);
crate::device::sequencer::draw_mon(buf, x + 19, y, state.monitoring);
@ -184,10 +185,10 @@ pub fn render (state: &Launcher, buf: &mut Buffer, area: Rect) -> Usually<Rect>
//separator.blit(buf, x, y + 41, Some(Style::default().dim()));
let mut y = y + 1;
y = y + LauncherGridView::new(
state, buf, Rect { x, y, width, height: 22 }, state.view.is_tracks()
state, buf, Rect { x, y, width, height: 8 }, state.view.is_tracks()
).draw()?.height;
y = y + draw_section_sequencer(state, buf, Rect { x, y, width, height: 28 })?.height;
y = y + draw_section_chains(state, buf, Rect { x, y, width, height: 21 })?.height;
y = y + draw_section_sequencer(state, buf, Rect { x, y, width, height: 8 })?.height;
y = y + draw_section_chains(state, buf, Rect { x, y, width, height: 8 })?.height;
if state.show_help {
let style = Some(Style::default().bold().white().not_dim().on_black().italic());
let hide = "[Left Right] Track [Up Down] Scene [, .] Value [F1] Toggle help ";
@ -292,6 +293,10 @@ fn draw_section_chains (state: &Launcher, buf: &mut Buffer, area: Rect) -> Usual
},
_ => {},
};
draw_highlight(buf, &Some(area), match state.view {
LauncherView::Chains => Style::default().green().dim(),
_ => Style::default().dim()
});
if let Some(chain) = &chain {
if let Some(plugin) = plugins.get(chain.focus) {
draw_highlight(buf, &Some(*plugin), match state.view {

View file

@ -49,7 +49,7 @@ pub fn timer (buf: &mut Buffer, x: u16, y: u16, beat: usize, steps: usize, time0
pub fn keys (buf: &mut Buffer, area: Rect, note1: u16) -> Usually<Rect> {
let bw = Style::default().dim();
let Rect { x, y, width, height } = area;
let h = 32.max(height.saturating_sub(2)*2)/2;
let h = height.saturating_sub(2);
for i in 0..h {
let y = y + i;
buf.set_string(x + 1, y, KEYS_VERTICAL[(i % 6) as usize], bw);