add background to modal (why does it expand completely?)

This commit is contained in:
🪞👃🪞 2025-04-04 21:05:56 +03:00
parent 1d1fc483ba
commit ef0213003a

View file

@ -67,14 +67,11 @@ impl Taggart {
pub(crate) const FG_MODAL: Color = Color::Rgb(255, 255, 255); pub(crate) const FG_MODAL: Color = Color::Rgb(255, 255, 255);
pub(crate) const BG_MODAL: Color = Color::Rgb(0, 0, 0); pub(crate) const BG_MODAL: Color = Color::Rgb(0, 0, 0);
fn modal (content: impl Content<TuiOut>) -> impl Content<TuiOut> { fn modal (content: impl Content<TuiOut>) -> impl Content<TuiOut> {
let position = |x|Fill::xy( let pos = |x|Fill::xy( Align::c(x));
Align::c(x)); let style = |x|Tui::modify(false, Modifier::DIM, Tui::fg_bg(Self::FG_MODAL, Self::BG_MODAL, x));
let style = |x|Tui::modify(false, Modifier::DIM, let border = |x|Margin::xy(1, 1, Bsp::b(Border(true, Lozenge(true, Default::default())), x));
Tui::fg_bg(Self::FG_MODAL, Self::BG_MODAL, x)); let bg = |x|Bsp::a(x, Repeat(" "));
let border = |x|Margin::xy(1, 1, Bsp::b( pos(style(border(bg(content))))
Border(true, Lozenge(true, Default::default())),
x));
position(style(border(content)))
} }
fn title_bar (&self) -> impl Content<TuiOut> { fn title_bar (&self) -> impl Content<TuiOut> {
status_bar( status_bar(