mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 12:46:42 +01:00
wip: draw phrase pool
This commit is contained in:
parent
a6b08a3249
commit
5b0feddbcb
4 changed files with 71 additions and 11 deletions
|
|
@ -7,13 +7,19 @@ impl Content for Arranger<Tui> {
|
|||
Layers::new(move|add|{
|
||||
add(&Stack::down(move|add|{
|
||||
add(&self.transport)?;
|
||||
let arrangement = &self.arrangement as &dyn Widget<Engine = Tui>;
|
||||
if let (Some(direction), Some(sequencer)) = (
|
||||
self.show_sequencer,
|
||||
self.arrangement.sequencer(),
|
||||
) {
|
||||
let arrangement = &self.arrangement as &dyn Widget<Engine = Tui>;
|
||||
let sequencer = sequencer as &dyn Widget<Engine = Tui>;
|
||||
add(&Split::new(direction, 20, arrangement, sequencer.min_y(20)))
|
||||
add(&arrangement.split(
|
||||
direction,
|
||||
20,
|
||||
self.phrases.clone()
|
||||
.split(direction.ccw(), 20, sequencer)
|
||||
.min_y(20)
|
||||
))
|
||||
} else {
|
||||
add(&self.arrangement)
|
||||
}
|
||||
|
|
@ -722,3 +728,17 @@ impl Handle<Tui> for ArrangerRenameModal<Tui> {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Content for PhrasePool<Tui> {
|
||||
type Engine = Tui;
|
||||
fn content (&self) -> impl Widget<Engine = Tui> {
|
||||
col!(
|
||||
"Phrases:",
|
||||
col!((i, phrase) in self.phrases.iter().enumerate() => format!("{i}"))
|
||||
)
|
||||
.bg(Color::Rgb(28, 35, 25))
|
||||
.border(Lozenge(Style::default()
|
||||
.bg(Color::Rgb(40, 50, 30))
|
||||
.fg(Color::Rgb(70, 80, 50))))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue