diff --git a/assets/default.toml b/assets/default.toml index 0fcd59e..caa83dc 100644 --- a/assets/default.toml +++ b/assets/default.toml @@ -2,10 +2,10 @@ debug = false [colors] -background = "#1e1e1e" # Dark gray background -foreground = "white" # White text -border_focused = "white" # White for focused widget borders -border_unfocused = "darkgray" # Dark gray for unfocused widget borders -row_highlight = "yellow" # Yellow highlight for selected row -row_alternate_bg = "#282828" # Slightly lighter gray for alternate rows -scrollbar = "white" # White scrollbar +background = "#1e1e1e" +foreground = "white" +border_focused = "white" +border_unfocused = "darkgray" +row_highlight = "yellow" +row_background = "darkgray" +row_alternate_bg = "#282828" diff --git a/src/config/types.rs b/src/config/types.rs index 8a61000..6eddaf4 100644 --- a/src/config/types.rs +++ b/src/config/types.rs @@ -25,10 +25,10 @@ pub struct Colors { pub row_highlight: Color, // Highlighted row color #[serde(deserialize_with = "deserialize_color")] - pub row_alternate_bg: Color, // Alternate row background color - + pub row_background: Color, // Row background color + #[serde(deserialize_with = "deserialize_color")] - pub scrollbar: Color, // Scrollbar color + pub row_alternate_bg: Color, // Alternate row background color } #[derive(Debug, Deserialize)] diff --git a/src/tui/mod.rs b/src/tui/mod.rs index 0ed58ec..511f3c2 100644 --- a/src/tui/mod.rs +++ b/src/tui/mod.rs @@ -1,5 +1,6 @@ pub mod layout; pub mod widgets; +pub mod picture; use std::io::{stdout, Result, Stdout}; diff --git a/src/tui/widgets/instances.rs b/src/tui/widgets/instances.rs index 7f3ab47..c015613 100644 --- a/src/tui/widgets/instances.rs +++ b/src/tui/widgets/instances.rs @@ -1,11 +1,10 @@ use crossterm::event::KeyCode; use ratatui::{ layout::{Constraint, Rect}, - style::{Color, Modifier, Style}, + style::{Modifier, Style}, text::Text, widgets::{ - Block, BorderType, Borders, Cell, Row, Scrollbar, ScrollbarOrientation, ScrollbarState, - Table, TableState, + Block, BorderType, Borders, Cell, Paragraph, Row, Scrollbar, ScrollbarOrientation, ScrollbarState, Table, TableState }, Frame, }; @@ -139,9 +138,9 @@ pub fn render(frame: &mut Frame, area: Rect, focused: FocusedArea, state: &mut S let status = if data.running { "Running" } else { "Stopped" }; let background_color = if i % 2 == 0 { - Color::Reset + SETTINGS.colors.row_background } else { - Color::Rgb(40, 40, 40) + SETTINGS.colors.row_alternate_bg }; Row::new(vec![ @@ -163,7 +162,7 @@ pub fn render(frame: &mut Frame, area: Rect, focused: FocusedArea, state: &mut S .row_highlight_style( Style::default() .add_modifier(Modifier::REVERSED) - .fg(Color::Yellow), + .fg(SETTINGS.colors.row_highlight), ) .highlight_spacing(ratatui::widgets::HighlightSpacing::Always); @@ -175,7 +174,7 @@ pub fn render(frame: &mut Frame, area: Rect, focused: FocusedArea, state: &mut S .begin_symbol(Some("▲")) .style( Style::default() - .fg(Color::White) + .fg(SETTINGS.colors.border_focused) .add_modifier(Modifier::BOLD), ) .thumb_symbol("┃")