summaryrefslogtreecommitdiff
path: root/src/layout.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/layout.zig')
-rw-r--r--src/layout.zig14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/layout.zig b/src/layout.zig
index 4c974fb7..bdef9675 100644
--- a/src/layout.zig
+++ b/src/layout.zig
@@ -433,6 +433,20 @@ pub fn placedRoomy(p: *Pardes, id: usize, before: *const [MAX_PANES]Rect) bool {
return true;
}
+/// Whether every unfolded pane sharing its column has its tag and
+/// `min_body_rows` (one alone in its column always fits).
+pub fn everyPaneRoomy(p: *Pardes) bool {
+ compute(p);
+ for (0..p.ncol) |c| {
+ if (p.col_n[c] < 2) continue;
+ for (p.col_panes[c][0..p.col_n[c]]) |k| {
+ const pane = p.panes[k] orelse continue;
+ if (!pane.collapsed and p.rects[k].h < minRows(p, k)) return false;
+ }
+ }
+ return true;
+}
+
/// Places `id` in column `c` by halving its tallest unfolded pane, when
/// that leaves both their rows; false, and `id` in no column, when not.
pub fn splitTallest(p: *Pardes, c: usize, id: usize) bool {