mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 13:16:44 +01:00
add widget dynamic helper and Split::up
This commit is contained in:
parent
038451e2f4
commit
97af45b576
4 changed files with 47 additions and 17 deletions
|
|
@ -3,19 +3,29 @@ use crate::*;
|
|||
impl Content for Arranger<Tui> {
|
||||
type Engine = Tui;
|
||||
fn content (&self) -> impl Widget<Engine = Tui> {
|
||||
Stack::down(move|add|{
|
||||
add(&self.transport)?;
|
||||
let arrangement = &self.arrangement as &dyn Widget<Engine = Tui>;
|
||||
if let Some(direction) = self.show_sequencer {
|
||||
add(&arrangement.split(direction, self.arrangement_split,
|
||||
self.phrases.clone().split(direction.ccw(), self.phrases_split,
|
||||
&self.editor as &dyn Widget<Engine = Tui>
|
||||
).min_y(self.arrangement_split)
|
||||
).fill_y())
|
||||
} else {
|
||||
add(&self.arrangement)
|
||||
}
|
||||
})
|
||||
Split::down(
|
||||
2,
|
||||
widget(&self.transport),
|
||||
Split::up(
|
||||
1,
|
||||
widget(&self.status),
|
||||
Split::down(
|
||||
self.arrangement_split,
|
||||
widget(&self.arrangement),
|
||||
Split::right(
|
||||
self.phrases_split,
|
||||
self.phrases.clone(),
|
||||
widget(&self.editor),
|
||||
)
|
||||
)
|
||||
)
|
||||
).fill_xy()
|
||||
}
|
||||
}
|
||||
impl Content for ArrangerStatusBar {
|
||||
type Engine = Tui;
|
||||
fn content (&self) -> impl Widget<Engine = Tui> {
|
||||
"status bar"
|
||||
}
|
||||
}
|
||||
impl Content for Arrangement<Tui> {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue