From f475095f4a725753b492eed33500eb82ee19a781 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 1 Sep 2024 06:57:16 +0100 Subject: [PATCH] feat(tui): remove some borders to clean up appearance --- crates/cli/src/tui/components/forge/expanded.rs | 8 ++++---- crates/cli/src/tui/components/repo/mod.rs | 6 +----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/crates/cli/src/tui/components/forge/expanded.rs b/crates/cli/src/tui/components/forge/expanded.rs index 514bd020..0f3faf93 100644 --- a/crates/cli/src/tui/components/forge/expanded.rs +++ b/crates/cli/src/tui/components/forge/expanded.rs @@ -23,7 +23,7 @@ impl<'a> HeightContraintLength for ExpandedForgeWidget<'a> { .iter() .map(HeightContraintLength::height_constraint_length) .sum::() - + 2 // top + bottom borders + + 2 // top title + bottom padding } } impl<'a> Widget for ExpandedForgeWidget<'a> { @@ -31,9 +31,9 @@ impl<'a> Widget for ExpandedForgeWidget<'a> { where Self: Sized, { - let block = Block::default() - .title(Title::from(format!(" forge: {} ", self.forge_alias)).alignment(Alignment::Left)) - .borders(Borders::ALL); + let block = Block::default().title( + Title::from(format!(" forge: {} ", self.forge_alias)).alignment(Alignment::Left), + ); let children = self.children(); let layout = Layout::default() .direction(Direction::Vertical) diff --git a/crates/cli/src/tui/components/repo/mod.rs b/crates/cli/src/tui/components/repo/mod.rs index 804e2637..349dc1d1 100644 --- a/crates/cli/src/tui/components/repo/mod.rs +++ b/crates/cli/src/tui/components/repo/mod.rs @@ -85,10 +85,6 @@ struct InnerRepoWidget<'a> { pub alert: Option<&'a str>, pub branches: Option<&'a RepoBranches>, pub log: Option<&'a git::graph::Log>, - // pub view_state: &'a actor::ViewState, - // pub main: &'a Commit, - // pub next: &'a Commit, - // pub dev: &'a Commit, } impl<'a> HeightContraintLength for InnerRepoWidget<'a> { fn height_constraint_length(&self) -> u16 { @@ -109,7 +105,7 @@ impl<'a> Widget for InnerRepoWidget<'a> { self.message, self.branches, )) - .borders(Borders::ALL); + .borders(Borders::TOP); if let Some(log) = self.log { CommitLog { log }.render(block.inner(area), buf); }