add CornersOuter

This commit is contained in:
🪞👃🪞 2024-12-21 20:50:48 +01:00
parent e7fbb359c7
commit 49fe3322e1
4 changed files with 17 additions and 3 deletions

View file

@ -115,7 +115,7 @@ render!(<Tui>|self: ArrangerTui|{
let arranger = ||lay!(|add|{ let arranger = ||lay!(|add|{
let color = self.color; let color = self.color;
add(&Fill::wh(Tui::bg(color.darkest.rgb, ())))?; add(&Fill::wh(Tui::bg(color.darkest.rgb, ())))?;
add(&Fill::wh(Lozenge(Style::default().fg(color.light.rgb).bg(color.darker.rgb))))?; add(&Fill::wh(CornersOuter(Style::default().fg(color.dark.rgb).bg(color.darkest.rgb))))?;
add(&Self::render_mode(self)) add(&Self::render_mode(self))
}); });
with_size(with_status(with_editbar(with_pool(with_transport(col!([ with_size(with_status(with_editbar(with_pool(with_transport(col!([

View file

@ -197,7 +197,9 @@ render!(<Tui>|self: PhraseListView<'a>|{
let title_color = TuiTheme::ti1(); let title_color = TuiTheme::ti1();
let upper_left = "Pool:"; let upper_left = "Pool:";
let upper_right = format!("({})", phrases.len()); let upper_right = format!("({})", phrases.len());
let color = ItemPalette::from(Color::Rgb(128,0,0));
Tui::bg(bg, lay!(move|add|{ Tui::bg(bg, lay!(move|add|{
add(&Fill::wh(CornersOuter(Style::default().fg(color.light.rgb).bg(bg))))?;
//add(&Lozenge(Style::default().bg(border_bg).fg(border_color)))?; //add(&Lozenge(Style::default().bg(border_bg).fg(border_color)))?;
add(&Tui::inset_xy(0, 1, Fill::wh(col!(move|add|match mode { add(&Tui::inset_xy(0, 1, Fill::wh(col!(move|add|match mode {
Some(PhraseListMode::Import(_, ref file_picker)) => add(file_picker), Some(PhraseListMode::Import(_, ref file_picker)) => add(file_picker),

View file

@ -65,13 +65,15 @@ render!(<Tui>|self: PianoHorizontal|{
let notes = move||PianoHorizontalNotes(&self); let notes = move||PianoHorizontalNotes(&self);
let cursor = move||PianoHorizontalCursor(&self); let cursor = move||PianoHorizontalCursor(&self);
let keys_width = 5; let keys_width = 5;
Fill::wh(Bsp::s( let border = Fill::wh(CornersOuter(Style::default().fg(self.color.dark.rgb).bg(self.color.darkest.rgb)));
let with_border = |x|lay!([border, Tui::inset_xy(1, 1, &x)]);
with_border(Fill::wh(Bsp::s(
Fixed::h(1, Bsp::e(Fixed::w(keys_width, ""), Fill::w(timeline()),)), Fixed::h(1, Bsp::e(Fixed::w(keys_width, ""), Fill::w(timeline()),)),
Bsp::e( Bsp::e(
Fixed::w(keys_width, keys()), Fixed::w(keys_width, keys()),
Fill::wh(lay!([&self.size, Fill::wh(lay!([Fill::wh(notes()), Fill::wh(cursor()),]))])), Fill::wh(lay!([&self.size, Fill::wh(lay!([Fill::wh(notes()), Fill::wh(cursor()),]))])),
), ),
)) )))
}); });
pub struct PianoHorizontalTimeline<'a>(&'a PianoHorizontal); pub struct PianoHorizontalTimeline<'a>(&'a PianoHorizontal);

View file

@ -197,6 +197,16 @@ border! {
"" "" "" ""
"🭼" "" "🭿" fn style (&self) -> Option<Style> { Some(self.0) } "🭼" "" "🭿" fn style (&self) -> Option<Style> { Some(self.0) }
}, },
CornersOuter {
"🭽" "" "🭾"
"" ""
"🭼" "" "🭿"
const W0: &'static str = "[";
const E0: &'static str = "]";
const N0: &'static str = "";
const S0: &'static str = "";
fn style (&self) -> Option<Style> { Some(self.0) }
},
Brackets { Brackets {
"" "" "" "" "" ""
"" "" "" ""