fix background of last arranger row

This commit is contained in:
🪞👃🪞 2024-07-23 23:28:11 +03:00
parent 088b5a5127
commit bd6f8ff9bf
2 changed files with 16 additions and 6 deletions

View file

@ -41,7 +41,7 @@ pub fn draw (
fn column_separators <'a> (offset: u16, cols: &'a [(usize, usize)]) -> impl Render + 'a {
move |buf: &mut Buffer, area: Rect|{
let style = Some(Style::default().fg(Color::Rgb(0,0,0)));
let style = Some(Style::default().fg(Nord::SEPARATOR));
for (_, x) in cols.iter() {
let x = offset + area.x + *x as u16 - 1;
for y in area.y..area.height+area.y {
@ -62,7 +62,7 @@ fn row_separators <'a> (rows: &'a [(usize, usize)]) -> impl Render + 'a {
for x in area.x..area.width+area.y-2 {
let cell = buf.get_mut(x, y);
cell.modifier = Modifier::UNDERLINED;
cell.underline_color = Color::Rgb(0, 0, 0);
cell.underline_color = Nord::SEPARATOR;
}
}
Ok(area)
@ -158,7 +158,7 @@ pub fn scene_rows <'a> (
offset: u16,
) -> impl Render + 'a {
move |buf: &mut Buffer, area: Rect| {
let black = Some(Style::default().fg(Color::Rgb(0, 0, 0)));
let black = Some(Style::default().fg(Nord::SEPARATOR));
let Rect { mut y, height, .. } = area;
for (_, x) in track_cols.iter() {
let x = *x as u16;
@ -173,8 +173,12 @@ pub fn scene_rows <'a> (
break
}
let h = 1.max((pulses / 96) as u16);
let area = Rect { x: area.x, y, width: area.width, height: h.min(area.height - y) };
scene_row(state, buf, area, scene, track_cols, offset)?;
scene_row(state, buf, Rect {
x: area.x,
y,
width: area.width,
height: h,//.min(area.height - y)
}, scene, track_cols, offset)?;
y = y + h
}
Ok(area)
@ -212,7 +216,7 @@ fn scene_row (
y,
width: *w as u16,
height: area.height,
}, Color::Rgb(60,100,50));
}, Nord::PLAYING);
}
}
}

View file

@ -10,6 +10,9 @@ pub trait Theme {
const YELLOW: Color;
const GREEN: Color;
const PLAYING: Color;
const SEPARATOR: Color;
fn bg_hier (focused: bool, entered: bool) -> Color {
if focused && entered {
Self::BG3
@ -62,4 +65,7 @@ impl Theme for Nord {
const RED: Color = Color::Rgb(191, 97, 106);
const YELLOW: Color = Color::Rgb(235, 203, 139);
const GREEN: Color = Color::Rgb(163, 190, 140);
const PLAYING: Color = Color::Rgb(60, 100, 50);
const SEPARATOR: Color = Color::Rgb(0, 0, 0);
}