Radish alpha
r
rad:z39mP9rQAaGmERfUMPULfPUi473tY
Radicle terminal user interface
Radicle
Git
Container widget improvements
Merged did:key:z6MkgFq6...nBGz opened 1 year ago
3 files changed +11 -7 0954d14a c2b3a874
modified src/ui/theme.rs
@@ -49,7 +49,11 @@ pub mod style {
        }
    }

-
    pub fn highlight() -> Style {
-
        cyan().not_dim().reversed()
+
    pub fn highlight(focus: bool) -> Style {
+
        if focus {
+
            cyan().not_dim().reversed()
+
        } else {
+
            cyan().dim().reversed()
+
        }
    }
}
modified src/ui/widget/container.rs
@@ -568,7 +568,7 @@ where
                .direction(Direction::Vertical)
                .constraints(vec![Constraint::Min(1)])
                .vertical_margin(1)
-
                .horizontal_margin(2)
+
                .horizontal_margin(1)
                .areas(top_area);
            top.render(RenderProps::from(top_area).focus(render.focus), frame)
        }
@@ -584,7 +584,7 @@ where
            let [bottom_area, _] = Layout::default()
                .direction(Direction::Vertical)
                .constraints(vec![Constraint::Min(1), Constraint::Length(1)])
-
                .horizontal_margin(2)
+
                .horizontal_margin(1)
                .areas(bottom_area);
            bottom.render(RenderProps::from(bottom_area).focus(render.focus), frame)
        }
@@ -682,10 +682,10 @@ where

        if props.handle_keys {
            match key {
-
                Key::Left => {
+
                Key::BackTab => {
                    self.prev();
                }
-
                Key::Right => {
+
                Key::Char('\t') => {
                    self.next(self.sections.len());
                }
                _ => {}
modified src/ui/widget/list.rs
@@ -249,7 +249,7 @@ where
                .rows(rows)
                .widths(widths)
                .column_spacing(1)
-
                .highlight_style(style::highlight());
+
                .highlight_style(style::highlight(render.focus));

            frame.render_stateful_widget(rows, render.area, &mut self.state);
        } else {