wip: fixing Map, centering

This commit is contained in:
🪞👃🪞 2025-01-01 17:00:28 +01:00
parent 059ff2ca79
commit d17d20e7db
10 changed files with 104 additions and 78 deletions

View file

@ -23,10 +23,11 @@ from_jack!(|jack|TransportTui Self {
has_clock!(|self: TransportTui|&self.clock);
audio!(|self: TransportTui, client, scope|ClockAudio(self).process(client, scope));
handle!(<Tui>|self: TransportTui, from|TransportCommand::execute_with_state(self, from));
render!(Tui: (self: TransportTui) => Align::x(Fixed::y(3, row!(
render!(Tui: (self: TransportTui) => PlayPause(false));
/*Align::x(Fixed::y(3, row!(
Fixed::x(5, Fixed::y(3, PlayPause(false))),
TransportView::new(self, Some(self.color), true),
))));
))));*/
impl std::fmt::Debug for TransportTui {
fn fmt (&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
f.debug_struct("TransportTui")
@ -111,14 +112,9 @@ render!(Tui: (self: TransportView) => {
pub struct PlayPause(pub bool);
render!(Tui: (self: PlayPause) => Tui::bg(
if self.0{Color::Rgb(0,128,0)}else{Color::Rgb(128,64,0)},
Fixed::x(5, Tui::either(self.0, Tui::fg(Color::Rgb(0, 255, 0), col!(
" 🭍🭑🬽 ",
" 🭞🭜🭘 ",
)), Tui::fg(Color::Rgb(255, 128, 0), col!(
" ▗▄▖ ",
" ▝▀▘ ",
))))
));
Fixed::x(5, Tui::either(self.0,
Tui::fg(Color::Rgb(0, 255, 0), Bsp::s(" 🭍🭑🬽 ", " 🭞🭜🭘 ",)),
Tui::fg(Color::Rgb(255, 128, 0), Bsp::s(" ▗▄▖ ", " ▝▀▘ ",))))));
impl HasFocus for TransportTui {
type Item = TransportFocus;
fn focused (&self) -> Self::Item {