From ef0213003a293697920387f476ed9037cd2deda8 Mon Sep 17 00:00:00 2001 From: unspeaker Date: Fri, 4 Apr 2025 21:05:56 +0300 Subject: [PATCH] add background to modal (why does it expand completely?) --- src/view.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/view.rs b/src/view.rs index ecf0719..cad70a0 100644 --- a/src/view.rs +++ b/src/view.rs @@ -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) -> impl Content { - 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 { status_bar(