mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-07 04:06:45 +01:00
re-add arrangement border
This commit is contained in:
parent
fe25da4f53
commit
2105d86428
2 changed files with 46 additions and 30 deletions
|
|
@ -3,6 +3,10 @@ use crate::*;
|
||||||
impl Content for Arranger<Tui> {
|
impl Content for Arranger<Tui> {
|
||||||
type Engine = Tui;
|
type Engine = Tui;
|
||||||
fn content (&self) -> impl Widget<Engine = Tui> {
|
fn content (&self) -> impl Widget<Engine = Tui> {
|
||||||
|
let focused = self.arrangement.focused;
|
||||||
|
let border_color = if focused{Color::Rgb(100, 110, 40)}else{Color::Rgb(70, 80, 50)};
|
||||||
|
let title_color = if focused{Color::Rgb(150, 160, 90)}else{Color::Rgb(120, 130, 100)};
|
||||||
|
let border = Lozenge(Style::default().bg(Color::Rgb(40, 50, 30)).fg(border_color));
|
||||||
Split::down(
|
Split::down(
|
||||||
1,
|
1,
|
||||||
row!(menu in self.menu.menus.iter() => {
|
row!(menu in self.menu.menus.iter() => {
|
||||||
|
|
@ -16,7 +20,11 @@ impl Content for Arranger<Tui> {
|
||||||
widget(&self.transport),
|
widget(&self.transport),
|
||||||
Split::down(
|
Split::down(
|
||||||
self.arrangement_split,
|
self.arrangement_split,
|
||||||
widget(&self.arrangement),
|
lay!(
|
||||||
|
widget(&self.arrangement).grow_y(1).border(border),
|
||||||
|
widget(&self.arrangement.size),
|
||||||
|
widget(&"[ ] Arrangement").fg(title_color).push_x(1),
|
||||||
|
),
|
||||||
Split::right(
|
Split::right(
|
||||||
self.phrases_split,
|
self.phrases_split,
|
||||||
self.phrases.clone(),
|
self.phrases.clone(),
|
||||||
|
|
@ -121,11 +129,15 @@ impl Content for Arrangement<Tui> {
|
||||||
fn content (&self) -> impl Widget<Engine = Tui> {
|
fn content (&self) -> impl Widget<Engine = Tui> {
|
||||||
Layers::new(move |add|{
|
Layers::new(move |add|{
|
||||||
match self.mode {
|
match self.mode {
|
||||||
ArrangementViewMode::Horizontal => add(&HorizontalArranger(&self)),
|
ArrangementViewMode::Horizontal => {
|
||||||
ArrangementViewMode::Vertical(factor) => add(&VerticalArranger(&self, factor)),
|
add(&HorizontalArranger(&self))
|
||||||
|
},
|
||||||
|
ArrangementViewMode::Vertical(factor) => {
|
||||||
|
add(&VerticalArranger(&self, factor))
|
||||||
|
},
|
||||||
}?;
|
}?;
|
||||||
let color = if self.focused{Color::Rgb(150, 160, 90)}else{Color::Rgb(120, 130, 100)};
|
let color = if self.focused{Color::Rgb(150, 160, 90)}else{Color::Rgb(120, 130, 100)};
|
||||||
add(&TuiStyle::fg("Project", color).push_x(2))?;
|
//add(&TuiStyle::fg("Project", color).push_x(2))?;
|
||||||
add(&self.size)
|
add(&self.size)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
@ -306,7 +318,7 @@ impl<'a> Content for VerticalArranger<'a, Tui> {
|
||||||
else { area.clip_w(scenes_w).clip_h(header_h) }, &CORNERS)?
|
else { area.clip_w(scenes_w).clip_h(header_h) }, &CORNERS)?
|
||||||
})
|
})
|
||||||
}))
|
}))
|
||||||
}).bg(bg.rgb);//.grow_y(1);//.border(border);
|
}).bg(bg.rgb);
|
||||||
let color = if self.0.focused {Color::Rgb(150, 160, 90)} else {Color::Rgb(120, 130, 100)};
|
let color = if self.0.focused {Color::Rgb(150, 160, 90)} else {Color::Rgb(120, 130, 100)};
|
||||||
let size = format!("{}x{}", self.0.size.w(), self.0.size.h());
|
let size = format!("{}x{}", self.0.size.w(), self.0.size.h());
|
||||||
let lower_right = TuiStyle::fg(size, color).pull_x(1).align_se().fill_xy();
|
let lower_right = TuiStyle::fg(size, color).pull_x(1).align_se().fill_xy();
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ impl Content for PhrasePool<Tui> {
|
||||||
let border = Lozenge(Style::default().bg(Color::Rgb(40, 50, 30)).fg(border_color));
|
let border = Lozenge(Style::default().bg(Color::Rgb(40, 50, 30)).fg(border_color));
|
||||||
let content = content.fill_xy().bg(Color::Rgb(28, 35, 25)).border(border);
|
let content = content.fill_xy().bg(Color::Rgb(28, 35, 25)).border(border);
|
||||||
let title_color = if *focused {Color::Rgb(150, 160, 90)} else {Color::Rgb(120, 130, 100)};
|
let title_color = if *focused {Color::Rgb(150, 160, 90)} else {Color::Rgb(120, 130, 100)};
|
||||||
let title = format!("Phrases ({})", phrases.len());
|
let title = format!("[ ] Phrases ({})", phrases.len());
|
||||||
let title = TuiStyle::fg(title, title_color).push_x(1);
|
let title = TuiStyle::fg(title, title_color).push_x(1);
|
||||||
Layers::new(move|add|{ add(&content)?; Ok(add(&title)?) })
|
Layers::new(move|add|{ add(&content)?; Ok(add(&title)?) })
|
||||||
}
|
}
|
||||||
|
|
@ -267,32 +267,36 @@ impl Content for PhraseEditor<Tui> {
|
||||||
let piano_roll = row!(keys, note_area).fill_x();
|
let piano_roll = row!(keys, note_area).fill_x();
|
||||||
let content = piano_roll.bg(Color::Rgb(40, 50, 30)).border(border);
|
let content = piano_roll.bg(Color::Rgb(40, 50, 30)).border(border);
|
||||||
let content = lay!(content, playhead);
|
let content = lay!(content, playhead);
|
||||||
let mut upper_left = String::from("Sequencer");
|
let mut upper_left = format!("[ ] Sequencer");
|
||||||
if let Some(phrase) = phrase {
|
if let Some(phrase) = phrase {
|
||||||
upper_left = format!("{upper_left}: {}", phrase.read().unwrap().name);
|
upper_left = format!("{upper_left}: {}", phrase.read().unwrap().name);
|
||||||
}
|
}
|
||||||
let mut upper_right = format!("Zoom: {} (+{}:{}*{}|{})",
|
let mut lower_right = format!(
|
||||||
pulses_to_name(time_scale),
|
"┤{}x{}├",
|
||||||
time_start, time_point.unwrap_or(0),
|
|
||||||
time_scale, time_clamp.unwrap_or(0),
|
|
||||||
);
|
|
||||||
if *focused && *entered {
|
|
||||||
upper_right = format!("Note: {} (+{}:{}|{}) {upper_right}",
|
|
||||||
pulses_to_name(*note_len),
|
|
||||||
note_start,
|
|
||||||
note_point.unwrap_or(0),
|
|
||||||
note_clamp.unwrap_or(0),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
let lower_right = format!(
|
|
||||||
"{{{}x{}}}",
|
|
||||||
self.width.load(Ordering::Relaxed),
|
self.width.load(Ordering::Relaxed),
|
||||||
self.height.load(Ordering::Relaxed),
|
self.height.load(Ordering::Relaxed),
|
||||||
);
|
);
|
||||||
|
lower_right = format!("┤Zoom: {}├─{lower_right}", pulses_to_name(time_scale));
|
||||||
|
//lower_right = format!("Zoom: {} (+{}:{}*{}|{})",
|
||||||
|
//pulses_to_name(time_scale),
|
||||||
|
//time_start, time_point.unwrap_or(0),
|
||||||
|
//time_scale, time_clamp.unwrap_or(0),
|
||||||
|
//);
|
||||||
|
if *focused && *entered {
|
||||||
|
lower_right = format!("┤Note: {} {}├─{lower_right}",
|
||||||
|
self.note_axis.read().unwrap().point.unwrap(),
|
||||||
|
pulses_to_name(*note_len));
|
||||||
|
//lower_right = format!("Note: {} (+{}:{}|{}) {upper_right}",
|
||||||
|
//pulses_to_name(*note_len),
|
||||||
|
//note_start,
|
||||||
|
//note_point.unwrap_or(0),
|
||||||
|
//note_clamp.unwrap_or(0),
|
||||||
|
//);
|
||||||
|
}
|
||||||
lay!(
|
lay!(
|
||||||
content,
|
content,
|
||||||
TuiStyle::fg(upper_left.to_string(), title_color).push_x(1).align_nw().fill_xy(),
|
TuiStyle::fg(upper_left.to_string(), title_color).push_x(1).align_nw().fill_xy(),
|
||||||
TuiStyle::fg(upper_right.to_string(), title_color).pull_x(1).align_ne().fill_xy(),
|
//TuiStyle::fg(upper_right.to_string(), title_color).pull_x(1).align_ne().fill_xy(),
|
||||||
TuiStyle::fg(lower_right.to_string(), title_color).pull_x(1).align_se().fill_xy(),
|
TuiStyle::fg(lower_right.to_string(), title_color).pull_x(1).align_se().fill_xy(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue