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