diff options
| author | user <user@clank> | 2026-08-14 20:26:33 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-14 20:26:33 +0200 |
| commit | f684056b6583d46016e1eb85300dde813a26f3d7 (patch) | |
| tree | 32d7f4d26e9f74043b9c5dc682f2e6c4d8cb0bfb /src | |
| parent | sl0ppty: the squares are back for zoom (diff) | |
| download | slosh-f684056b6583d46016e1eb85300dde813a26f3d7.tar.gz slosh-f684056b6583d46016e1eb85300dde813a26f3d7.tar.xz slosh-f684056b6583d46016e1eb85300dde813a26f3d7.zip | |
sl0ppty: halve the padding between the frame's buttons
Reported twice now, with two different marks, so the glyph was never the
variable: the gap between two marks is blank cells plus whatever blank each
glyph carries inside its own cell, and the second part differs by glyph and by
font. An underscore keeps its ink on the baseline and a square fills its box,
so two blank cells between them read as more than two between the square and
the x.
One blank cell instead of two. The difference is still there — it is a property
of the font, not of the layout — but at half the size it stops being the thing
you notice. Chasing it with per-mark padding would have been compensating for a
font I cannot see, and would come apart for anyone who changed a mark.
It also gives three columns of every frame back. The three buttons are seven
columns now rather than ten, which matters on a frame that only has twenty-four
to begin with.
The click targets are two cells each rather than three. That is still a
reasonable mouse target, but it is a real trade against a row whose rightmost
button closes the pane, and worth saying out loud rather than discovering.
Diffstat (limited to 'src')
| -rw-r--r-- | src/app.c | 16 |
1 files changed, 14 insertions, 2 deletions
@@ -1910,14 +1910,19 @@ static void draw_frame(app_t *a, screen_t *s, node_t *leaf) { uint16_t bx = (uint16_t)(x1 - 1); for (size_t i = 0; i < sizeof btns / sizeof *btns; i++) { char cell[24]; - snprintf(cell, sizeof cell, " %s ", btns[i].mark); + /* One space, not two. The gap between two marks is blank cells plus + * whatever blank each glyph carries inside its own cell, and that second + * part is not the same for a low underscore as for a square that fills + * its box. Two cells made the difference plain; one makes it small, and + * gives three columns of every frame back at the same time. */ + snprintf(cell, sizeof cell, "%s ", btns[i].mark); /* Measured in cells rather than assumed: a mark is yours to choose and * may be more than one character. Booking three cells for a * two-character mark would draw it over its neighbour and hand the * neighbour's hit a cell it does not own. */ uint16_t mw = cells(btns[i].mark); if (!mw) mw = 1; - uint16_t bw = (uint16_t)(mw + 2); + uint16_t bw = (uint16_t)(mw + 1); if (bx < r.x + 4 + bw) break; uint16_t px = (uint16_t)(bx - bw + 1); bool hot = ptr_on(a, px, r.y, bw, 1); @@ -1931,6 +1936,13 @@ static void draw_frame(app_t *a, screen_t *s, node_t *leaf) { btn_x = px; avail = (uint16_t)(avail > bw ? avail - bw : 0); } + /* One blank between the rule and the first button, so the group is not + * welded to the frame the way a title without its space would be. */ + if (has_btn && btn_x > (uint16_t)(r.x + 1)) { + screen_text(s, (uint16_t)(btn_x - 1), r.y, " ", PANE_BTN, NO_COLOR, 0); + btn_x = (uint16_t)(btn_x - 1); + avail = (uint16_t)(avail > 1 ? avail - 1 : 0); + } } { |
