mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 12:16:42 +01:00
almost sane focus higlighting
This commit is contained in:
parent
4c9eed6fce
commit
c06b9d16e2
4 changed files with 30 additions and 31 deletions
|
|
@ -145,36 +145,32 @@ pub fn render (state: &Launcher, buf: &mut Buffer, area: Rect) -> Usually<Rect>
|
|||
separator.blit(buf, x, y + 5, Some(Style::default().dim()));
|
||||
separator.blit(buf, x, y + 22, Some(Style::default().dim()));
|
||||
separator.blit(buf, x, y + 41, Some(Style::default().dim()));
|
||||
let (w, mut highlight) = draw_tracks(state, buf, track_area.x, track_area.y);
|
||||
let (w, mut track_highlight) = draw_tracks(state, buf, track_area.x, track_area.y);
|
||||
if state.col() == 0 {
|
||||
highlight = Some(scenes);
|
||||
track_highlight = Some(scenes);
|
||||
}
|
||||
draw_crossings(state, buf, x + w - 2, y + 1);
|
||||
draw_box(buf, Rect { x, y: y + 1, width, height: height - 1 });
|
||||
let style = Some(Style::default().green().dim());
|
||||
crate::device::chain::draw_as_row(
|
||||
&*state.chains[0].state(), buf, chain_area, style
|
||||
)?;
|
||||
let chain = &*state.chains[0].state();
|
||||
let (_, plugins) = crate::device::chain::draw_as_row(chain, buf, chain_area, style)?;
|
||||
match state.view {
|
||||
LauncherView::Tracks => draw_box_styled(buf, track_area, style),
|
||||
LauncherView::Sequencer => draw_box_styled(buf, seq_area, style),
|
||||
LauncherView::Chains => draw_box_styled(buf, Rect { height: 18, ..chain_area }, style),
|
||||
};
|
||||
draw_highlight(state, buf, &highlight);
|
||||
draw_highlight(state, buf, &track_highlight, match state.view {
|
||||
LauncherView::Tracks => Style::default().green().not_dim(),
|
||||
_ => Style::default().green().dim()
|
||||
});
|
||||
draw_highlight(state, buf, &Some(plugins[chain.focus]), match state.view {
|
||||
LauncherView::Chains => Style::default().green().not_dim(),
|
||||
_ => Style::default().green().dim()
|
||||
});
|
||||
draw_sequencer(state, buf, seq_area.x, seq_area.y + 1, seq_area.width, seq_area.height - 2)?;
|
||||
if state.show_help {
|
||||
let style = Some(Style::default().bold().white().not_dim().on_black().italic());
|
||||
//" [Tab] ".blit(buf, 1, match state.view {
|
||||
//LauncherView::Tracks => 21,
|
||||
//LauncherView::Sequencer => 40,
|
||||
//LauncherView::Chains => 0,
|
||||
//}, style);
|
||||
//" [Shift-Tab] ".blit(buf, 1, match state.view {
|
||||
//LauncherView::Tracks => 40,
|
||||
//LauncherView::Sequencer => 0,
|
||||
//LauncherView::Chains => 21,
|
||||
//}, style);
|
||||
let hide = "[F1] Toggle help ";
|
||||
let hide = "[Left/Right] Track [Up/Down] Scene [,/.] Value [F1] Toggle help ";
|
||||
hide.blit(buf, width - hide.len() as u16, height - 1, style);
|
||||
}
|
||||
Ok(area)
|
||||
|
|
@ -293,16 +289,19 @@ fn draw_sequencer (
|
|||
&sequencer.state(), buf, x, y + 1, width,
|
||||
);
|
||||
crate::device::sequencer::horizontal::cursor(
|
||||
&sequencer.state(), buf, x, y + 1,
|
||||
&sequencer.state(), buf, x, y + 1, match state.view {
|
||||
LauncherView::Sequencer => Style::default().green().not_dim(),
|
||||
_ => Style::default().green().dim(),
|
||||
}
|
||||
);
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
fn draw_highlight (
|
||||
state: &Launcher, buf: &mut Buffer, highlight: &Option<Rect>
|
||||
state: &Launcher, buf: &mut Buffer, highlight: &Option<Rect>, style: Style
|
||||
) {
|
||||
if let Some(area) = highlight {
|
||||
draw_box_styled(buf, *area, Some(Style::default().green().dim()));
|
||||
draw_box_styled(buf, *area, Some(style));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue