summaryrefslogtreecommitdiff
path: root/core/layout.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/layout.zig')
-rw-r--r--core/layout.zig16
1 files changed, 10 insertions, 6 deletions
diff --git a/core/layout.zig b/core/layout.zig
index c0d21d6d..5550ef4a 100644
--- a/core/layout.zig
+++ b/core/layout.zig
@@ -594,7 +594,7 @@ pub fn wantedTagRows(p: *Pardes, id: usize) u16 {
var wrap_room: [32 * 1024]u8 = undefined;
var wrap_fba = std.heap.FixedBufferAllocator.init(&wrap_room);
const wa = wrap_fba.allocator();
- const prefix = tagline.prefixIn(p, wa, pane) catch return pane.tag_rows;
+ const prefix = tagline.restPrefix(p, wa, pane) catch return pane.tag_rows;
const whole = std.mem.concat(wa, u8, &.{ prefix, tagline.curTail(pane) }) catch return pane.tag_rows;
const shown = tagline.wrapTag(p.settings.tab, wa, whole, tagline.tagWidth(p, id)) catch return pane.tag_rows;
return @intCast(@max(BOX_H, @min(shown.rows(), MAX_TAG_ROWS)));
@@ -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 = pardes.Band.takes(p, id);
- if (band > 0) return @max(1, pane.tag_rows -| pane.band_rows) + band + 4;
+ const band = if (pardes.Band.over(pane)) 0 else pardes.Band.takes(p, id);
+ 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;
}