aboutsummaryrefslogtreecommitdiffstats
path: root/src/app_draw.c
diff options
context:
space:
mode:
authoruser <user@clank>2026-09-22 11:59:10 +0200
committeruser <user@clank>2026-09-22 11:59:10 +0200
commitcb0d993fa284005d5679b628bb08d51f12812b8c (patch)
tree9d28b86f925255a24adb27306c6dde62e9f86292 /src/app_draw.c
parentsidebar: air between tabs (tab_gap) (diff)
downloadslosh-cb0d993fa284005d5679b628bb08d51f12812b8c.tar.gz
slosh-cb0d993fa284005d5679b628bb08d51f12812b8c.tar.xz
slosh-cb0d993fa284005d5679b628bb08d51f12812b8c.zip
tabs: a plate under the ones you are not in (tab_idle_bg)
The active tab has been filled with the accent since the strip existed; every other tab was words on the background. That leaves the strip with one shape on it and nothing to compare it against -- where a tab ends, how far the row you are about to click reaches, and in the sidebar which rows are tabs rather than statuses, all had to be read off the text. tab_idle_bg fills them. Barely off the background and in the label's own grey, because this is not a second highlight: it gives a tab edges, and it gives the accent something to be brighter than, which on a strip of short labels is most of how the eye finds the tab it is in. Hover keeps it for the same reason the active tab keeps its fill -- losing the plate under the pointer would read as the tab going away -- so hovering still lands on the text, and the bell mark sits on the plate rather than punching a hole in it. Derived a third of the way from default_bg to tab_idle when nobody names it, the same bargain tab_status_fg and tab_status_stripe already make: both ends are colours every theme in contrib defines, so each gets a plate in its own family -- paper lightens, phosphor greens, mono stays grey -- without a line added to any of them. Naming it wins, and naming your own background is how you ask for the bare tabs back. The `+ new tab` button and the gaps between tabs stay unpainted: the button is the one row in the list that does not mean "go here", and tab_gap is air between plates, which is what makes them read as separate tabs at all.
Diffstat (limited to '')
-rw-r--r--src/app_draw.c27
1 files changed, 18 insertions, 9 deletions
diff --git a/src/app_draw.c b/src/app_draw.c
index a363143..a8b40f5 100644
--- a/src/app_draw.c
+++ b/src/app_draw.c
@@ -1868,13 +1868,20 @@ static uint16_t draw_tab_cell(app_t *a, screen_t *s, size_t i, uint16_t x,
* hover colour if that width turns out to be under the pointer — which
* costs a repaint of a few cells and guarantees the lit cells are the
* registered ones. */
+ /* Every tab is a plate: the active one in the accent, the rest in
+ * `tab_idle_bg`. The quiet fill is what makes a strip of labels read as
+ * tabs — where one ends and the next begins, and how far the row the
+ * pointer will hit actually extends — and it is what the active fill is
+ * brighter *than*. A theme that wants the old bare strip sets it to its own
+ * background. */
uint16_t w = screen_text(
s, x, y, label, editing ? RENAME_FG : (active ? TAB_ACTIVE_FG : TAB_IDLE),
- editing ? RENAME_BG : (active ? TAB_ACTIVE_BG : NO_COLOR),
+ editing ? RENAME_BG : (active ? TAB_ACTIVE_BG : TAB_IDLE_BG),
editing ? ATTR_BOLD : attrs);
- /* Hovering keeps the active tab's fill — it is still the tab you are in —
- * so its feedback lands on the text instead. An inactive tab has no fill
- * to keep, and brightens. */
+ /* Hovering keeps the tab's own fill — the active one because it is still
+ * the tab you are in, an inactive one because losing its plate under the
+ * pointer would read as the tab going away — so the feedback lands on the
+ * text, which brightens. */
/* The bell keeps its own colour here too, rather than taking the tab's —
* an indicator drawn in the same dim grey as the label it sits next to is
* an indicator you have to already be looking for. */
@@ -1882,13 +1889,13 @@ static uint16_t draw_tab_cell(app_t *a, screen_t *s, size_t i, uint16_t x,
char mark[24];
snprintf(mark, sizeof mark, "%s ", CFG.bell_mark);
w = (uint16_t)(w + screen_text(s, (uint16_t)(x + w), y, mark, BELL_C,
- active ? TAB_ACTIVE_BG : NO_COLOR,
+ active ? TAB_ACTIVE_BG : TAB_IDLE_BG,
ATTR_BOLD));
}
uint16_t hit_w = max_w ? max_w : w;
if (!editing && ptr_on(a, x, y, hit_w, 1))
screen_text(s, x, y, label, active ? TAB_ACTIVE_HOVER_FG : TAB_HOVER,
- active ? TAB_ACTIVE_BG : NO_COLOR, attrs | ATTR_BOLD);
+ active ? TAB_ACTIVE_BG : TAB_IDLE_BG, attrs | ATTR_BOLD);
/* While a pane is in your hand, every tab it does not already live in is
* somewhere it could go, and `ptr_on` says nothing during a drag by design --
@@ -2101,9 +2108,11 @@ static size_t wrap_cells(const char *text, uint16_t width, size_t max,
len += clen;
if (p[len] == ' ') brk = len; /* the last break point that still fits */
}
- if (!p[len]) brk = len; /* what is left fits whole */
- else if (!brk) brk = len; /* one long word: split it rather than stall */
- if (!brk) break; /* not even one cell of room */
+ if (!p[len])
+ brk = len; /* what is left fits whole */
+ else if (!brk)
+ brk = len; /* one long word: split it rather than stall */
+ if (!brk) break; /* not even one cell of room */
if (brk >= STATUS_ROW_CAP) brk = STATUS_ROW_CAP - 1;
memcpy(out[n], p, brk);
out[n][brk] = 0;