aboutsummaryrefslogtreecommitdiffstats
path: root/src/config.c
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-14 20:32:16 +0200
committeruser <user@clank>2026-08-14 20:32:16 +0200
commit686421cee2ebf7dac0d4da28cfa23fe201272352 (patch)
treebb3c46b23a378323c33845fa532300f135d5d1de /src/config.c
parentsl0ppty: plain ASCII for the frame's buttons (diff)
downloadslosh-686421cee2ebf7dac0d4da28cfa23fe201272352.tar.gz
slosh-686421cee2ebf7dac0d4da28cfa23fe201272352.tar.xz
slosh-686421cee2ebf7dac0d4da28cfa23fe201272352.zip
sl0ppty: the status line says what the pointer is on
The frame's affordances are nearly all one character wide, and the widest one is invisible: a border that splits when you click it looks exactly like a border. Hovering anything now puts a word in the middle of the status line. Read off the hit list rather than tracked. Anything that registers a hit gets a hint by being named in one table, and nothing has to remember to raise or clear one — which also means the hint cannot disagree about what is under the pointer with the thing that would actually be clicked, since both are the same lookup. The status line is drawn after everything else has registered, so the list is complete by the time it asks. It is centred in what is left between the two ends rather than in the row. Centring it in the row would put it under the session name on a narrow screen, and a hint that overwrites the thing it is explaining is worse than no hint; it is simply not drawn when it does not fit, which has a test with a deliberately long pane title. Two of that test's checks were wrong before they were right, in the ordinary way: one searched for a substring that also occurs in the text on the right, and one assumed forty-four columns was too narrow to fit a hint when it was not. Both now assert against measured positions rather than my guess at them.
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index 7159d47..6ce7a7f 100644
--- a/src/config.c
+++ b/src/config.c
@@ -171,6 +171,7 @@ void config_defaults(config_t *c) {
c->rounded = true;
c->title_align = ALIGN_CENTER;
c->title_inset = 2;
+ c->hints = true;
c->pane_buttons = true;
snprintf(c->zoom_mark, sizeof c->zoom_mark, "#");
snprintf(c->zoom_on_mark, sizeof c->zoom_on_mark, "*");
@@ -256,6 +257,7 @@ void config_defaults(config_t *c) {
c->finder_sel_bg = accent;
c->bell = accent;
+ c->hint = bright;
c->minbar = dim;
c->minbar_hover = accent;
c->pane_button = dim;
@@ -375,6 +377,7 @@ bool config_load(config_t *c, const char *path, char *err, size_t errcap) {
c->title_inset =
(uint16_t)kdl_arg_int(kdl_child(root, "title_inset"), 0, c->title_inset);
+ c->hints = kdl_arg_bool(kdl_child(root, "hints"), 0, c->hints);
c->pane_buttons =
kdl_arg_bool(kdl_child(root, "pane_buttons"), 0, c->pane_buttons);
const char *zm = kdl_arg(kdl_child(root, "zoom_mark"), 0, NULL);
@@ -482,6 +485,7 @@ bool config_load(config_t *c, const char *path, char *err, size_t errcap) {
{"finder_sel_fg", &c->finder_sel_fg},
{"finder_sel_bg", &c->finder_sel_bg},
{"bell", &c->bell},
+ {"hint", &c->hint},
{"minbar", &c->minbar},
{"minbar_hover", &c->minbar_hover},
{"pane_button", &c->pane_button},