From 784c3df28372d379eb0a419a9d17a5076ea1f934 Mon Sep 17 00:00:00 2001 From: raylu <90059+raylu@users.noreply.github.com> Date: Sun, 13 Jul 2025 13:00:56 -0700 Subject: [PATCH] feat(config): BorderType --- .config/config.toml | 16 ++++++-- television/channels/prototypes.rs | 63 ++++++++++++++--------------- television/config/mod.rs | 22 +++-------- television/config/themes.rs | 6 +-- television/config/ui.rs | 66 +++++++++++++++++++++++++------ television/draw.rs | 12 ++---- television/main.rs | 54 ++++++++++++++++--------- television/screen/input.rs | 33 +++++++++------- television/screen/layout.rs | 9 +++-- television/screen/preview.rs | 41 +++++++++---------- television/screen/results.rs | 17 +++++--- television/television.rs | 10 +++-- 12 files changed, 208 insertions(+), 141 deletions(-) diff --git a/.config/config.toml b/.config/config.toml index 57cfc93..725caed 100644 --- a/.config/config.toml +++ b/.config/config.toml @@ -54,10 +54,6 @@ use_nerd_font_icons = false # └───────────────────────────────────────┘ ui_scale = 100 -# Where to place the input bar in the UI (top or bottom) -input_bar_position = "top" -# The input prompt string (defaults to ">" if not specified) -input_prompt = ">" # What orientation should tv be (landscape or portrait) orientation = "landscape" # The theme to use for the UI @@ -100,6 +96,14 @@ remote_control = { enabled = true, visible = false } # Feature-specific configurations # Each feature can have its own configuration section +[ui.input_bar] +# Where to place the input bar in the UI (top or bottom) +position = "top" +# The input prompt string (defaults to ">" if not specified) +prompt = ">" +# header = "{}" +border_type = "rounded" # https://docs.rs/ratatui/latest/ratatui/widgets/block/enum.BorderType.html#variants + [ui.status_bar] # Status bar separators (bubble): #separator_open = "" @@ -108,12 +112,16 @@ remote_control = { enabled = true, visible = false } separator_open = "" separator_close = "" +[ui.results_panel] +border_type = "rounded" + [ui.preview_panel] # Preview panel size (percentage of screen width/height) size = 50 #header = "{}" #footer = "" scrollbar = true +border_type = "rounded" [ui.remote_control] # Whether to show channel descriptions in remote control mode diff --git a/television/channels/prototypes.rs b/television/channels/prototypes.rs index 55f7ad4..979c351 100644 --- a/television/channels/prototypes.rs +++ b/television/channels/prototypes.rs @@ -1,9 +1,10 @@ use crate::cli::parse_source_entry_delimiter; +use crate::config::ui::InputBarConfig; use crate::{ config::{KeyBindings, ui}, event::Key, features::Features, - screen::layout::{InputPosition, Orientation}, + screen::layout::Orientation, }; use anyhow::Result; use rustc_hash::FxHashMap; @@ -387,16 +388,14 @@ pub struct UiSpec { // `layout` is clearer for the user but collides with the overall `Layout` type. #[serde(rename = "layout", alias = "orientation", default)] pub orientation: Option, - #[serde(default)] - pub input_bar_position: Option, - #[serde(default)] - pub input_header: Option