phrases: autoshow, autoedit

This commit is contained in:
🪞👃🪞 2024-11-02 20:25:28 +02:00
parent 02fa22e2ea
commit 2f904ed78b
4 changed files with 14 additions and 26 deletions

View file

@ -96,7 +96,7 @@ impl Content for PhraseEditor<Tui> {
})
}).fill_x();
let cursor = CustomWidget::new(|to|Ok(Some(to)), move|to: &mut TuiOutput|{
Ok(if *entered {
Ok(if *focused && *entered {
let area = to.area();
if let (Some(time), Some(note)) = (time_point, note_point) {
let x1 = area.x() + (time / time_scale) as u16;
@ -104,7 +104,7 @@ impl Content for PhraseEditor<Tui> {
let y = area.y() + note.saturating_sub(note_start) as u16 / 2;
let c = if note % 2 == 0 { "" } else { "" };
for x in x1..x2 {
to.blit(&c, x, y, Some(Style::default().fg(color)));
to.blit(&c, x, y, Some(Style::default().fg(Color::Rgb(0,255,0))));
}
}
})