mirror of
https://codeberg.org/unspeaker/perch.git
synced 2025-12-06 01:26:43 +01:00
add background to modal (why does it expand completely?)
This commit is contained in:
parent
1d1fc483ba
commit
ef0213003a
1 changed files with 5 additions and 8 deletions
13
src/view.rs
13
src/view.rs
|
|
@ -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(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue