Skip to content

Commit

Permalink
fixup: full border on splits being broken (#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
mierak authored Dec 20, 2024
1 parent 423cfe7 commit 7935d12
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/ui/tab_screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,17 @@ impl TabScreen {
area: Rect,
context: &AppContext,
) -> Result<()> {
self.for_each_pane(panes, self.panes, area, context, &mut |pane, area, block| {
screen_call!(pane, render(frame, area, context))?;
frame.render_widget(block, area);
Ok(())
})?;
self.for_each_pane(
panes,
self.panes,
area,
context,
&mut |pane, area, block, block_area| {
screen_call!(pane, render(frame, area, context))?;
frame.render_widget(block, block_area);
Ok(())
},
)?;
Ok(())
}

Expand All @@ -89,7 +95,7 @@ impl TabScreen {
configured_panes: &PaneOrSplitWithPosition,
area: Rect,
context: &AppContext,
callback: &mut impl FnMut(&mut Panes<'_>, Rect, Block) -> Result<()>,
callback: &mut impl FnMut(&mut Panes<'_>, Rect, Block, Rect) -> Result<()>,
) -> Result<()> {
match configured_panes {
PaneOrSplitWithPosition::Pane(Pane { pane, border, id, .. }) => {
Expand All @@ -103,7 +109,7 @@ impl TabScreen {
let mut pane = panes.get_mut(*pane);
let pane_area = block.inner(area);
self.pane_areas.insert(*id, pane_area);
callback(&mut pane, pane_area, block)?;
callback(&mut pane, pane_area, block, area)?;
}
PaneOrSplitWithPosition::Split {
direction,
Expand Down Expand Up @@ -276,7 +282,7 @@ impl TabScreen {
}

pub fn before_show(&mut self, panes: &mut PaneContainer, area: Rect, context: &AppContext) -> Result<()> {
self.for_each_pane(panes, self.panes, area, context, &mut |pane, rect, _block| {
self.for_each_pane(panes, self.panes, area, context, &mut |pane, rect, _, _| {
screen_call!(pane, calculate_areas(rect, context));
screen_call!(pane, before_show(context))?;
Ok(())
Expand Down

0 comments on commit 7935d12

Please sign in to comment.