diff --git a/src/ui.rs b/src/ui.rs index 8402a5e1..8d732aad 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -248,7 +248,7 @@ impl Layout { ]) .areas(area); let [right_top, right_bottom] = - Layout::vertical([Constraint::Percentage(65), Constraint::Percentage(35)]) + Layout::vertical([Constraint::Percentage(60), Constraint::Percentage(40)]) .areas(right); [left, right_top, right_bottom].into() diff --git a/src/ui/theme.rs b/src/ui/theme.rs index 54034d84..313cebc9 100644 --- a/src/ui/theme.rs +++ b/src/ui/theme.rs @@ -39,9 +39,9 @@ impl Theme { pub fn default_dark() -> Self { Self { border_style: Style::default().fg(Color::Indexed(240)), - focus_border_style: Style::default().cyan(), + focus_border_style: Style::default().fg(Color::Indexed(249)), scroll_style: Style::default().fg(Color::Indexed(240)), - focus_scroll_style: style::cyan(), + focus_scroll_style: Style::default().fg(Color::Indexed(249)), shortcuts_keys_style: style::yellow().dim(), shortcuts_action_style: style::gray().dim(), textview_style: style::reset(), @@ -49,10 +49,18 @@ impl Theme { dim_no_focus: false, } } + + pub fn highlight(&self, focus: bool) -> Style { + if focus { + style::cyan().not_dim().reversed() + } else { + style::cyan().dim().reversed() + } + } } pub mod style { - use ratatui::style::{Color, Style, Stylize}; + use ratatui::style::{Color, Style}; pub fn reset() -> Style { Style::default().fg(Color::Reset) @@ -93,12 +101,4 @@ pub mod style { pub fn darkgray() -> Style { Style::default().fg(Color::DarkGray) } - - pub fn highlight(focus: bool) -> Style { - if focus { - cyan().not_dim().reversed() - } else { - cyan().dim().reversed() - } - } } diff --git a/src/ui/widget.rs b/src/ui/widget.rs index 01f9d8f7..e117c8a3 100644 --- a/src/ui/widget.rs +++ b/src/ui/widget.rs @@ -555,7 +555,7 @@ where .rows(rows) .widths(widths) .column_spacing(self.spacing.into()) - .row_highlight_style(style::highlight(ui.has_focus)); + .row_highlight_style(ui.theme.highlight(ui.has_focus)); let table = if !area_focus && self.dim { table.dim() @@ -746,13 +746,13 @@ where ui.theme.scroll_style }), )) - .highlight_style(style::highlight(ui.has_focus)) + .highlight_style(ui.theme.highlight(ui.has_focus)) .style(tree_style) } else { tui_tree_widget::Tree::new(&items) .expect("all item identifiers are unique") .style(tree_style) - .highlight_style(style::highlight(ui.has_focus)) + .highlight_style(ui.theme.highlight(ui.has_focus)) }; frame.render_stateful_widget(tree, area, &mut state.internal);