#[allow(unused)] use crate::*; impl Tui { pub const fn fg (color: Color, w: T) -> Foreground { Foreground(color, w) } pub const fn bg (color: Color, w: T) -> Background { Background(color, w) } pub const fn fg_bg (fg: Color, bg: Color, w: T) -> Background> { Background(bg, Foreground(fg, w)) } pub const fn modify (enable: bool, modifier: Modifier, w: T) -> Modify { Modify(enable, modifier, w) } pub const fn bold (enable: bool, w: T) -> Modify { Self::modify(enable, Modifier::BOLD, w) } pub const fn border (enable: bool, style: S, w: T) -> Bordered { Bordered(enable, style, w) } } mod tui_border; pub use self::tui_border::*; mod tui_button; pub use self::tui_button::*; mod tui_color; pub use self::tui_color::*; mod tui_error; pub use self::tui_error::*; mod tui_field; pub use self::tui_field::*; mod tui_phat; pub use self::tui_phat::*; mod tui_repeat; pub use self::tui_repeat::*; mod tui_scroll; pub use self::tui_scroll::*; mod tui_string; pub use self::tui_string::*; mod tui_number; //pub use self::tui_number::*; mod tui_tryptich; //pub use self::tui_tryptich::*; impl> Draw for Foreground { fn draw (&self, to: &mut TuiOut) { let area = self.layout(to.area()); to.fill_fg(area, self.0); to.place_at(area, &self.1); } } impl> Draw for Background { fn draw (&self, to: &mut TuiOut) { let area = self.layout(to.area()); to.fill_bg(area, self.0); to.place_at(area, &self.1); } } pub struct Modify(pub bool, pub Modifier, pub T); impl> Layout for Modify {} impl> Draw for Modify { fn draw (&self, to: &mut TuiOut) { to.fill_mod(to.area(), self.0, self.1); self.2.draw(to) } } pub struct Styled(pub Option