diff options
author | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-12-20 21:48:43 -0500 |
---|---|---|
committer | Jeff Zhao <jeff.no.zhao@gmail.com> | 2021-12-20 21:48:43 -0500 |
commit | b24f37c36a88b91c7f3ca915af63bd082458cd1f (patch) | |
tree | faf48b019ac5b931abfd7ee32bebba2b6e5d047d /src/ui | |
parent | f20dc6c1e189aacbade1994699b217bb7026bbfb (diff) |
remove area recalculation
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/views/tui_folder_view.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/ui/views/tui_folder_view.rs b/src/ui/views/tui_folder_view.rs index d019327..f867d48 100644 --- a/src/ui/views/tui_folder_view.rs +++ b/src/ui/views/tui_folder_view.rs @@ -45,13 +45,14 @@ impl<'a> Widget for TuiFolderView<'a> { let is_default_layout = constraints == &display_options.default_layout; let layout_rect = if display_options.show_borders() { - let layout = calculate_layout_with_borders(area, constraints); let area = Rect { y: area.top() + 1, height: area.height - 2, ..area }; + let layout = calculate_layout_with_borders(area, constraints); + let block = Block::default().borders(Borders::ALL); let inner = block.inner(area); block.render(area, buf); @@ -262,12 +263,6 @@ pub fn calculate_layout(area: Rect, constraints: &[Constraint; 3]) -> Vec<Rect> } pub fn calculate_layout_with_borders(area: Rect, constraints: &[Constraint; 3]) -> Vec<Rect> { - let area = Rect { - y: area.top() + 1, - height: area.height - 2, - ..area - }; - let block = Block::default().borders(Borders::ALL); let inner = block.inner(area); |