aboutsummaryrefslogtreecommitdiff
path: root/src/layout.rs
diff options
context:
space:
mode:
authorOgulcan Celik <ogulcancelik@gmail.com>2026-06-21 14:02:19 +0300
committerOgulcan Celik <ogulcancelik@gmail.com>2026-06-21 14:03:59 +0300
commit4421c0febbb03a1a4264729a70fb7c440a3b9ca8 (patch)
tree72d1ade2b453ac1948daa85c50c2b6e3599cc204 /src/layout.rs
parent92a10fc044d42b216317696a4e8e6f70d7cc7a7d (diff)
fix: add configurable pane gaps
refs #271
Diffstat (limited to 'src/layout.rs')
-rw-r--r--src/layout.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/layout.rs b/src/layout.rs
index 06426f85..cd611d10 100644
--- a/src/layout.rs
+++ b/src/layout.rs
@@ -2,7 +2,10 @@
use std::cmp::Reverse;
-use ratatui::layout::{Direction, Rect};
+use ratatui::{
+ layout::{Direction, Rect},
+ widgets::Borders,
+};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, serde::Serialize, serde::Deserialize)]
pub struct PaneId(u32);
@@ -37,6 +40,8 @@ pub struct PaneInfo {
/// Visible scrollbar lane, when scrollback is present. `inner_rect` may still
/// exclude a stable hidden gutter when this is `None`.
pub scrollbar_rect: Option<Rect>,
+ /// Borders drawn around this pane after UI chrome is applied.
+ pub borders: Borders,
pub is_focused: bool,
}
@@ -414,6 +419,7 @@ fn collect_panes(node: &Node, area: Rect, focus: PaneId, result: &mut Vec<PaneIn
// inner_rect is set during render when we know if borders are shown
inner_rect: area,
scrollbar_rect: None,
+ borders: Borders::NONE,
is_focused: *id == focus,
});
}
@@ -919,6 +925,7 @@ mod tests {
rect: Rect::new(10, 10, 10, 10),
inner_rect: Rect::new(10, 10, 10, 10),
scrollbar_rect: None,
+ borders: Borders::NONE,
is_focused: true,
};
let small_overlap_first = PaneInfo {
@@ -926,6 +933,7 @@ mod tests {
rect: Rect::new(0, 10, 10, 2),
inner_rect: Rect::new(0, 10, 10, 2),
scrollbar_rect: None,
+ borders: Borders::NONE,
is_focused: false,
};
let larger_overlap_second = PaneInfo {
@@ -933,6 +941,7 @@ mod tests {
rect: Rect::new(0, 10, 10, 8),
inner_rect: Rect::new(0, 10, 10, 8),
scrollbar_rect: None,
+ borders: Borders::NONE,
is_focused: false,
};
let panes = vec![focused.clone(), small_overlap_first, larger_overlap_second];