summaryrefslogtreecommitdiff
path: root/core/layout.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/layout.zig')
-rw-r--r--core/layout.zig24
1 files changed, 14 insertions, 10 deletions
diff --git a/core/layout.zig b/core/layout.zig
index 4b5b7d2c..47f9bf0d 100644
--- a/core/layout.zig
+++ b/core/layout.zig
@@ -605,7 +605,7 @@ pub fn wantedTagRows(p: *Pardes, id: usize) u16 {
/// The rows pane `id`'s tag's text takes now: out of rest its head
/// (TagState) after what of its prefix stays (UX D1), wrapped at its width
/// as Pardes.sync wraps it; at rest what wantedTagRows says.
-fn headRows(p: *Pardes, id: usize) u16 {
+pub fn headRows(p: *Pardes, id: usize) u16 {
const pane = p.panes[id] orelse return BOX_H;
if (pane.collapsed or !pane.tag_expanded) return BOX_H;
var wrap_room: [Pane.prefix_room]u8 = undefined;
@@ -1519,19 +1519,23 @@ 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 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).
+/// out of rest has the rows for its head and its band, drawn over its body
+/// (UX DESIGN I1); 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).
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);
+ const band = if (pane.isTerminal() or pane.addon != null) 0 else pardes.Band.takes(p, id);
if (band > 0) {
- // Over its body as Pardes.sync lays it out (UX E3): the head's rows
- // and the band under them, or the rows the tag keeps from rest
- // where those are more; 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).
+ // 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 = @max(wantedTagRows(p, id), headRows(p, id) + band);
+ if (p.view().tag_state.kind != .pick) 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);
}