diff options
Diffstat (limited to 'core/layout.zig')
| -rw-r--r-- | core/layout.zig | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/core/layout.zig b/core/layout.zig index de12294b..5550ef4a 100644 --- a/core/layout.zig +++ b/core/layout.zig @@ -1471,13 +1471,17 @@ pub fn compute(p: *Pardes) void { /// The fewest rows a pane is laid out with: a terminal keeps its tag and /// `min_body_rows` (a shorter one loses its prompt and reads busy for /// ever), a text pane may shrink to its tag, as acme's windows do. A tag -/// out of rest keeps its band and four body rows, borrowed from the -/// column's other panes, which shrink to their tags until it rolls up -/// (walk UI SPEC §3.6). +/// out of rest keeps its band and a body of 60 % of the pane and 6 rows at +/// least (UX D6), borrowed from the column's other panes, which shrink to +/// their tags until it rolls up (walk UI SPEC §3.6). fn floorRows(p: *Pardes, id: usize) u16 { const pane = p.panes[id] orelse return 0; const band = if (pardes.Band.over(pane)) 0 else pardes.Band.takes(p, id); - if (band > 0) return @max(1, pane.tag_rows -| pane.band_rows) + band + 4; + if (band > 0) { + const above = @max(1, pane.tag_rows -| pane.band_rows) + band; + // A body of 60 % is one and a half times what is above it. + return above + @max(pardes.Band.body_rows, (3 * above + 1) / 2); + } return if (pane.isTerminal()) @max(1, pane.tag_rows) + min_body_rows else 1; } |
