mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-08 12:46:42 +01:00
22 lines
734 B
Rust
22 lines
734 B
Rust
use crate::*;
|
|
|
|
pub struct Field<T, U>(pub ItemPalette, pub T, pub U)
|
|
where T: AsRef<str> + Send + Sync, U: AsRef<str> + Send + Sync;
|
|
|
|
impl<T, U> Content<Tui> for Field<T, U>
|
|
where T: AsRef<str> + Send + Sync, U: AsRef<str> + Send + Sync
|
|
{
|
|
fn content (&self) -> impl Content<Tui> {
|
|
row!(
|
|
Tui::bg(self.0.darkest.rgb, Tui::fg(self.0.darker.rgb, "▐")),
|
|
|
|
Tui::bg(self.0.darker.rgb, Tui::fg(self.0.lighter.rgb,
|
|
Tui::bold(true, format!("{}", self.1.as_ref())))),
|
|
|
|
Tui::bg(self.0.darkest.rgb, Tui::fg(self.0.darker.rgb, "▌")),
|
|
|
|
Tui::bg(self.0.darkest.rgb, Tui::fg(self.0.lightest.rgb,
|
|
format!("{} ", self.2.as_ref())))
|
|
)
|
|
}
|
|
}
|