From b5fbd14f912803fbee59bf70e08c5f3172bcc4d0 Mon Sep 17 00:00:00 2001 From: unspeaker Date: Fri, 25 Apr 2025 13:58:19 +0300 Subject: [PATCH] tui_phat: export LO and HI chars --- tui/src/tui_content/tui_phat.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tui/src/tui_content/tui_phat.rs b/tui/src/tui_content/tui_phat.rs index 73f4ec1..01a852f 100644 --- a/tui/src/tui_content/tui_phat.rs +++ b/tui/src/tui_content/tui_phat.rs @@ -9,13 +9,15 @@ pub struct Phat { pub colors: [Color;4], } impl Phat { + pub const LO: &'static str = "▄"; + pub const HI: &'static str = "▀"; /// A phat line pub fn lo (fg: Color, bg: Color) -> impl Content { - Fixed::y(1, Tui::fg_bg(fg, bg, RepeatH(&"▄"))) + Fixed::y(1, Tui::fg_bg(fg, bg, RepeatH(Self::LO))) } /// A phat line pub fn hi (fg: Color, bg: Color) -> impl Content { - Fixed::y(1, Tui::fg_bg(fg, bg, RepeatH(&"▀"))) + Fixed::y(1, Tui::fg_bg(fg, bg, RepeatH(Self::HI))) } } impl> Content for Phat { @@ -24,6 +26,10 @@ impl> Content for Phat { let top = Fixed::y(1, Self::lo(bg, hi)); let low = Fixed::y(1, Self::hi(bg, lo)); let content = Tui::fg_bg(fg, bg, &self.content); - Min::xy(self.width, self.height, Bsp::s(top, Bsp::n(low, Fill::xy(content)))) + Min::xy( + self.width, + self.height, + Bsp::s(top, Bsp::n(low, Fill::xy(content))) + ) } }