diff options
Diffstat (limited to 'core/layout.zig')
| -rw-r--r-- | core/layout.zig | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/core/layout.zig b/core/layout.zig index ae15c6e9..b15c7200 100644 --- a/core/layout.zig +++ b/core/layout.zig @@ -1608,22 +1608,24 @@ pub fn compute(p: *Pardes) void { /// `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 has the rows for its head and its band under it, drawn over -/// its body (UX DESIGN I1, M4); a picker's (code actions' too: its body is -/// the preview) a body of 60 % of the pane and 6 rows at least under them -/// (UX D6). Those are borrowed from the column's other panes, which shrink -/// to their tags until it rolls up (walk UI SPEC §3.6). A terminal's and a -/// kind's size is their user's: a transient state never resizes the pty -/// under a program or a kind's view (a PDF's), it is drawn over as much of -/// them as it has (R3). +/// its body (UX DESIGN I1, M4). The pane a picker's preview shows in (code +/// actions' asking pane too: its body is the preview) has a body of 60 % of +/// the pane and 6 rows at least under its tag, and its head and band when +/// it asked (UX D6, DESIGN O1). Those are borrowed from the column's other +/// panes, which shrink to their tags until it rolls up (walk UI SPEC +/// §3.6). A terminal's and a kind's size is their user's: a transient +/// state never resizes the pty under a program or a kind's view (a PDF's), +/// it is drawn over as much of them as it has (R3). fn floorRows(p: *Pardes, id: usize) u16 { const pane = p.panes[id] orelse return 0; const under = if (pane.isTerminal() or pane.addon != null) 0 else headRows(p, id) + pardes.Band.takes(p, id); - if (under > 0) { + const preview = pardes.Pick.previewPane(p, id); + if (under > 0 or preview) { // Worked out from the state, never the last sync's rows (the first // layout after a head changed read the rows of the one before, and // the next moved the body). const above = wantedTagRows(p, id) + under; - if (p.view().tag_state.kind != .pick) return above; + if (!preview) return above; // 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); } |
