wip: tek_test again

This commit is contained in:
🪞👃🪞 2024-09-09 22:57:00 +03:00
parent fa8282a9d5
commit 4c23aed40a
16 changed files with 190 additions and 172 deletions

View file

@ -5,5 +5,5 @@ version = "0.1.0"
[dependencies]
tek_core = { path = "../tek_core" }
tek_mixer = { path = "../tek_mixer" }
#tek_mixer = { path = "../tek_mixer" }
tek_sequencer = { path = "../tek_sequencer" }

View file

@ -8,17 +8,19 @@ pub fn main () -> Usually<()> {
pub struct Demo<E: Engine> {
index: usize,
items: Vec<Box<dyn Component<E>>>
items: Vec<Box<dyn Widget<Engine = E>>>
}
impl Demo<Tui> {
fn new () -> Self {
let mut items: Vec<Box<dyn Component<Tui>>> = vec![];
let mut items: Vec<Box<dyn Widget<Engine = Tui>>> = vec![];
items.push(Box::new(tek_sequencer::TransportPlayPauseButton {
_engine: Default::default(),
value: Some(TransportState::Stopped),
focused: true
}));
items.push(Box::new(tek_sequencer::TransportPlayPauseButton {
_engine: Default::default(),
value: Some(TransportState::Rolling),
focused: false
}));
@ -26,15 +28,16 @@ impl Demo<Tui> {
}
}
impl<E: Engine> Content for Demo<E> {
type Engine = E;
fn content (&self) -> impl Widget<Engine = E> {
Align::Center(Layers(&[
impl Content for Demo<Tui> {
type Engine = Tui;
fn content (&self) -> impl Widget<Engine = Tui> {
Align::Center(Layers([
&Outset::WH(2, 1, FillBg(Color::Rgb(0,128,128))),
&Layers(&[
&"---------",
&Align::Center("...")
])
&self.items[self.index]
//&Layers(&[
//&"---------",
//&Align::Center("...")
//])
]))
}
}