aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authoruser <user@clank>2026-09-09 20:49:18 +0200
committeruser <user@clank>2026-09-09 20:49:18 +0200
commit2d006fdc97df7eecde0f49f94f24e096bcdebe28 (patch)
treeb0e45b3b4d2828ab119d645fed2350004909a9c5 /src
parentpane: shift consumed by the character is consumed, tell the encoder (diff)
downloadslosh-2d006fdc97df7eecde0f49f94f24e096bcdebe28.tar.gz
slosh-2d006fdc97df7eecde0f49f94f24e096bcdebe28.tar.xz
slosh-2d006fdc97df7eecde0f49f94f24e096bcdebe28.zip
compact: the minimised bar sits below a shared line, not on the border
A compact pane owns no border cells -- its bottom border is the shared line one cell outside its rect. With panes minimised, that cell was the bar's top row: the chips sat directly on the bottom panes' content, reading as frames cut into the pane. Classic panes carry their own border row and never collided. The layout now reserves one extra row above the bar in compact, and draw_compact_lines strokes the boundary there: it joins the outer ring with real junctions, a divider from above ends into it, and a focused bottom pane re-strokes its stretch like any shared line.
Diffstat (limited to 'src')
-rw-r--r--src/app_draw.c15
-rw-r--r--src/app_layout.c11
2 files changed, 24 insertions, 2 deletions
diff --git a/src/app_draw.c b/src/app_draw.c
index a3221e8..9a2c89e 100644
--- a/src/app_draw.c
+++ b/src/app_draw.c
@@ -2210,6 +2210,21 @@ void draw_compact_lines(app_t *a, screen_t *s) {
if (!ar.x || !ar.y) return; /* no room for a ring: no lines to share */
stroke_ring(s, ar, FRAME_IDLE, 0, true);
+ /* The line between the tree and the minimised bar: the bottom panes'
+ * shared border, on the row the layout reserved for it (a compact pane
+ * owns no border cells, so without this row the chips sat directly on the
+ * panes' content). Drawn before the divider end-extensions, so a vertical
+ * divider from above ends into it as a ┴ the same way it meets the ring,
+ * and re-strokable by a focused bottom pane like any shared line. */
+ rect_t bar = cur(a)->min_bar;
+ if (bar.h) {
+ uint16_t ly = (uint16_t)(bar.y - 1);
+ uint16_t x0 = (uint16_t)(ar.x - 1), x1 = (uint16_t)(ar.x + ar.w);
+ for (uint16_t x = x0; x <= x1; x++)
+ stroke(s, x, ly, (uint8_t)((x > x0 ? BX_L : 0) | (x < x1 ? BX_R : 0)),
+ FRAME_IDLE, 0, true);
+ }
+
/* The dividers' own cells first, their end-extensions after: an end only
* ever joins a line that is already there — the ring, or a perpendicular
* divider — which is what makes the junction glyphs, and what keeps a
diff --git a/src/app_layout.c b/src/app_layout.c
index 1b15f47..db43056 100644
--- a/src/app_layout.c
+++ b/src/app_layout.c
@@ -482,8 +482,15 @@ void layout(app_t *a) {
bool no_room = false;
cur(a)->min_bar = (rect_t){0, 0, 0, 0};
if (nmin) {
- if (r.h >= (uint16_t)(MIN_PANE_ROWS + 5)) {
- tree_r.h = (uint16_t)(r.h - 3);
+ /* Compact spends one row more: a compact pane's bottom border is the
+ * shared line one cell *outside* its rect, and with the bar directly
+ * below, that cell is the chips' top row -- the chips sat on the border.
+ * The extra row gives the line somewhere to live; draw_compact_lines
+ * strokes it. A classic pane carries its own bottom border and needs no
+ * such row. */
+ uint16_t bar_rows = CFG.compact ? 4 : 3;
+ if (r.h >= (uint16_t)(MIN_PANE_ROWS + 2 + bar_rows)) {
+ tree_r.h = (uint16_t)(r.h - bar_rows);
cur(a)->min_bar = (rect_t){r.x, (uint16_t)(r.y + r.h - 3), r.w, 3};
} else {
no_room = true;