fbpr: reenable background

This commit is contained in:
🪞👃🪞 2024-12-06 00:15:53 +01:00
parent bf3c7630a4
commit 2561e5221d

View file

@ -22,11 +22,11 @@ impl<'a, T: HasEditor> From<&'a T> for PhraseView<'a> {
let height = editor.size.h(); let height = editor.size.h();
let note_point = editor.note_point.load(Ordering::Relaxed); let note_point = editor.note_point.load(Ordering::Relaxed);
let mut note_lo = editor.note_lo.load(Ordering::Relaxed); let mut note_lo = editor.note_lo.load(Ordering::Relaxed);
let mut note_hi = 127.min(note_lo + height);
if note_point < note_lo { if note_point < note_lo {
note_lo = note_point; note_lo = note_point;
editor.note_lo.store(note_lo, Ordering::Relaxed); editor.note_lo.store(note_lo, Ordering::Relaxed);
} }
let mut note_hi = 127.min(note_lo + height);
if note_point > note_hi { if note_point > note_hi {
note_lo += note_point - note_hi; note_lo += note_point - note_hi;
note_hi = note_point; note_hi = note_point;
@ -132,11 +132,6 @@ impl<'a> Content for PhraseView<'a> {
) )
.fill_x() .fill_x()
.bg(Color::Rgb(40, 50, 30)), .bg(Color::Rgb(40, 50, 30)),
//.border(Lozenge(Style::default().bg(Color::Rgb(40, 50, 30)).fg(if *focused{
//Color::Rgb(100, 110, 40)
//} else {
//Color::Rgb(70, 80, 50)
//}))),
Widget::new(|to:[u16;2]|Ok(Some(to.clip_h(1))), move|to: &mut TuiOutput|{ Widget::new(|to:[u16;2]|Ok(Some(to.clip_h(1))), move|to: &mut TuiOutput|{
//let playhead_inactive = Style::default().fg(Color::Rgb(255,255,255)).bg(Color::Rgb(40,50,30)); //let playhead_inactive = Style::default().fg(Color::Rgb(255,255,255)).bg(Color::Rgb(40,50,30));
//let playhead_active = playhead_inactive.clone().yellow().bold().not_dim(); //let playhead_active = playhead_inactive.clone().yellow().bold().not_dim();
@ -351,11 +346,19 @@ impl PhraseViewMode {
//cell.set_fg(Color::Rgb(48, 64, 56)); //cell.set_fg(Color::Rgb(48, 64, 56));
let style = Style::default().fg(Color::Rgb(255, 255, 255)); let style = Style::default().fg(Color::Rgb(255, 255, 255));
let mut notes_on = [false;128]; let mut notes_on = [false;128];
for (y, _) in (127..0).enumerate() { for (y, note) in (0..127).rev().enumerate() {
for (x, _) in (0..phrase.length).step_by(time_zoom).enumerate() { for (x, time) in (0..target.width).map(|x|(x, x*time_zoom)) {
let cell = target.get_mut(x, y).unwrap(); let cell = target.get_mut(x, y).unwrap();
cell.set_fg(Color::Rgb(28, 35, 25)); cell.set_fg(Color::Rgb(38, 45, 35));
cell.set_char('·'); cell.set_char(if time % 384 == 0 {
'│'
} else if time % 96 == 0 {
'╎'
} else if note % 12 == 0 {
'-'
} else {
'·'
});
} }
} }
for (x, time_start) in (0..phrase.length).step_by(time_zoom).enumerate() { for (x, time_start) in (0..phrase.length).step_by(time_zoom).enumerate() {