diff --git a/bin/commands/issue/select.rs b/bin/commands/issue/select.rs index 50b20bed..49bf6876 100644 --- a/bin/commands/issue/select.rs +++ b/bin/commands/issue/select.rs @@ -294,7 +294,7 @@ impl TryFrom<(&Context, &TerminalInfo)> for State { show_search: false, }, preview: PreviewState { - show: false, + show: true, issue: items.first().cloned(), selected_comments, comment: CommentState { cursor: (0, 0) }, @@ -492,7 +492,7 @@ fn browser_page(channel: &Channel) -> Widget { if state.section == Some(Section::Browser) { shortcuts = [shortcuts, [("/", "search")].to_vec()].concat() } - [shortcuts, [("p", "preview"), ("?", "help")].to_vec()].concat() + [shortcuts, [("p", "toggle preview"), ("?", "help")].to_vec()].concat() }; ShortcutsProps::default() @@ -579,8 +579,8 @@ fn issue(channel: &Channel) -> Widget { .on_update(|state| { SplitContainerProps::default() .heights([Constraint::Length(5), Constraint::Min(1)]) - .border_color(state.theme.border_color) - .focus_border_color(state.theme.focus_border_color) + .border_style(state.theme.border_style) + .focus_border_style(state.theme.focus_border_style) .split_focus(SplitContainerFocus::Bottom) .to_boxed_any() .into() @@ -595,6 +595,7 @@ fn issue_details(channel: &Channel) -> Widget { .on_update(|state: &State| { IssueDetailsProps::default() .issue(state.preview.issue.clone()) + .dim(state.theme.dim_no_focus) .to_boxed_any() .into() }) @@ -622,6 +623,7 @@ fn comment_tree(channel: &Channel) -> Widget { .items(root.to_vec()) .selected(Some(selected)) .opened(Some(opened.clone())) + .dim(state.theme.dim_no_focus) .to_boxed_any() .into() }) @@ -666,6 +668,7 @@ fn comment(channel: &Channel) -> Widget { .footer(Some(reactions)) .cursor(state.preview.comment.cursor) .show_scroll_progress(true) + .dim(state.theme.dim_no_focus) .to_boxed_any() .into() }), @@ -673,8 +676,8 @@ fn comment(channel: &Channel) -> Widget { .to_widget(tx.clone()) .on_update(|state| { ContainerProps::default() - .border_color(state.theme.border_color) - .focus_border_color(state.theme.focus_border_color) + .border_style(state.theme.border_style) + .focus_border_style(state.theme.focus_border_style) .to_boxed_any() .into() }) @@ -705,6 +708,7 @@ fn help_page(channel: &Channel) -> Widget { TextViewProps::default() .content(help_text()) .cursor(state.help.cursor) + .dim(state.theme.dim_no_focus) .to_boxed_any() .into() }), @@ -731,8 +735,8 @@ fn help_page(channel: &Channel) -> Widget { .to_widget(tx.clone()) .on_update(|state| { ContainerProps::default() - .border_color(state.theme.border_color) - .focus_border_color(state.theme.focus_border_color) + .border_style(state.theme.border_style) + .focus_border_style(state.theme.focus_border_style) .to_boxed_any() .into() }); diff --git a/bin/commands/issue/select/ui.rs b/bin/commands/issue/select/ui.rs index 2b36631c..745bcd9c 100644 --- a/bin/commands/issue/select/ui.rs +++ b/bin/commands/issue/select/ui.rs @@ -127,8 +127,8 @@ impl Browser { HeaderProps::default() .columns(props.header.clone()) - .border_color(state.theme.border_color) - .focus_border_color(state.theme.focus_border_color) + .border_style(state.theme.border_style) + .focus_border_style(state.theme.focus_border_style) .to_boxed_any() .into() })) @@ -149,6 +149,7 @@ impl Browser { .columns(props.columns) .items(state.browser.issues()) .selected(state.browser.selected) + .dim(state.theme.dim_no_focus) .to_boxed_any() .into() }), @@ -158,16 +159,16 @@ impl Browser { FooterProps::default() .columns(browse_footer(&props)) - .border_color(state.theme.border_color) - .focus_border_color(state.theme.focus_border_color) + .border_style(state.theme.border_style) + .focus_border_style(state.theme.focus_border_style) .to_boxed_any() .into() })) .to_widget(tx.clone()) .on_update(|state| { ContainerProps::default() - .border_color(state.theme.border_color) - .focus_border_color(state.theme.focus_border_color) + .border_style(state.theme.border_style) + .focus_border_style(state.theme.focus_border_style) .hide_footer(BrowserProps::from(state).show_search) .to_boxed_any() .into() diff --git a/bin/main.rs b/bin/main.rs index 38aa9842..a001e219 100644 --- a/bin/main.rs +++ b/bin/main.rs @@ -1,8 +1,8 @@ mod cob; mod commands; mod git; -mod ui; mod settings; +mod ui; use std::ffi::OsString; use std::io; diff --git a/bin/ui/widget.rs b/bin/ui/widget.rs index 87c4622b..650527f2 100644 --- a/bin/ui/widget.rs +++ b/bin/ui/widget.rs @@ -19,6 +19,7 @@ use super::items::IssueItem; #[derive(Clone, Default)] pub struct IssueDetailsProps { issue: Option, + dim: bool, } impl IssueDetailsProps { @@ -26,6 +27,11 @@ impl IssueDetailsProps { self.issue = issue; self } + + pub fn dim(mut self, dim: bool) -> Self { + self.dim = dim; + self + } } pub struct IssueDetails { @@ -120,6 +126,12 @@ impl View for IssueDetails { [Constraint::Length(8), Constraint::Fill(1)], ); + let table = if !render.focus && props.dim { + table.dim() + } else { + table + }; + frame.render_widget(table, area); } else { let center = layout::centered_rect(render.area, 50, 10);