add --bpm flag

This commit is contained in:
🪞👃🪞 2025-01-02 16:38:04 +01:00
parent 42e2ef2a50
commit 94491a323a
11 changed files with 78 additions and 57 deletions

View file

@ -7,14 +7,8 @@ pub struct PhraseSelector {
pub(crate) time: String,
}
// TODO: Display phrases always in order of appearance
render!(Tui: (self: PhraseSelector) => Fixed::xy(24, 1, row!(
Tui::fg(self.color.lightest.rgb, Tui::bold(true, &self.title)),
Tui::fg_bg(self.color.lighter.rgb, self.color.base.rgb, row!(
format!("{:8}", &self.name[0..8.min(self.name.len())]),
Tui::bg(self.color.dark.rgb, &self.time),
)),
)));
render!(Tui: (self: PhraseSelector) =>
Field(self.color, self.title, format!("{} {}", self.time, self.name)));
impl PhraseSelector {
@ -31,7 +25,7 @@ impl PhraseSelector {
} else {
String::from(" ")
};
Self { title: "Now:|", time, name, color, }
Self { title: "Now", time, name, color, }
}
// beats until switchover
@ -59,7 +53,7 @@ impl PhraseSelector {
} else {
(" ".into(), " ".into(), TuiTheme::g(64).into())
};
Self { title: " Next|", time, name, color, }
Self { title: "Next", time, name, color, }
}
}