tui: ItemPalette->ItemTheme

This commit is contained in:
🪞👃🪞 2025-04-27 02:04:18 +03:00
parent aa66760b8c
commit 7ba37f3f02
2 changed files with 9 additions and 9 deletions

View file

@ -1,9 +1,9 @@
use crate::*;
pub struct FieldH<T, U>(pub ItemPalette, pub T, pub U);
pub struct FieldH<T, U>(pub ItemTheme, pub T, pub U);
impl<T: Content<TuiOut>, U: Content<TuiOut>> Content<TuiOut> for FieldH<T, U> {
fn content (&self) -> impl Render<TuiOut> {
let Self(ItemPalette { darkest, dark, lighter, lightest, .. }, title, value) = self;
let Self(ItemTheme { darkest, dark, lighter, lightest, .. }, title, value) = self;
row!(
Tui::fg_bg(dark.rgb, darkest.rgb, ""),
Tui::fg_bg(lighter.rgb, dark.rgb, Tui::bold(true, title)),
@ -13,10 +13,10 @@ impl<T: Content<TuiOut>, U: Content<TuiOut>> Content<TuiOut> for FieldH<T, U> {
}
}
pub struct FieldV<T, U>(pub ItemPalette, pub T, pub U);
pub struct FieldV<T, U>(pub ItemTheme, pub T, pub U);
impl<T: Content<TuiOut>, U: Content<TuiOut>> Content<TuiOut> for FieldV<T, U> {
fn content (&self) -> impl Render<TuiOut> {
let Self(ItemPalette { darkest, dark, lighter, lightest, .. }, title, value) = self;
let Self(ItemTheme { darkest, dark, lighter, lightest, .. }, title, value) = self;
let sep1 = Tui::bg(darkest.rgb, Tui::fg(dark.rgb, ""));
let sep2 = Tui::bg(darkest.rgb, Tui::fg(dark.rgb, ""));
let title = Tui::bg(dark.rgb, Tui::fg(lighter.rgb, Tui::bold(true, title)));