aboutsummaryrefslogtreecommitdiffstats
path: root/src/config.c
diff options
context:
space:
mode:
authoruser <user@clank>2026-08-14 13:59:05 +0200
committeruser <user@clank>2026-08-14 13:59:05 +0200
commit4bb2bb5f05dda628722ae363fa4580aa69f37e7c (patch)
tree4c06be8b88295a266405a9ec28e67993e4936fae /src/config.c
parentsl0ppty: drag greys the other panes, and dim_unfocused (diff)
downloadslosh-4bb2bb5f05dda628722ae363fa4580aa69f37e7c.tar.gz
slosh-4bb2bb5f05dda628722ae363fa4580aa69f37e7c.tar.xz
slosh-4bb2bb5f05dda628722ae363fa4580aa69f37e7c.zip
sl0ppty: dashed borders and a deeper push-back while dragging
Two changes to the same moment, on opposite sides of the chrome boundary. Every pane that is not being dragged now draws a dashed border, because every one of them is somewhere the pane could be dropped and a dashed frame says so without needing a legend. The pane in your hand keeps a solid one, so the two states are distinguishable by shape and not only by colour — which matters on a terminal whose palette makes the greying subtle, and to anyone who would not see the greying at all. The pane actually under the pointer still takes the existing drop-target highlight on top of the dashes: these are all targets, that one is the one you are on. Borders are chrome, so this is not a shader and could not have been. It lives in draw_frame, keyed off the same drag.moved that gates the greying, so a press that turns out to be a click neither greys nor dashes anything. The greying itself gets a second pass: desaturated *and* darkened, rather than only desaturated. Grey alone still competes for attention at the same brightness, which is what made the dragged pane fail to pop. Two shaders instead of one that does both, because "colourless" and "recessed" are different things to want and want separate knobs — drag_grayscale 200 and drag_dim 140. This is the first thing to actually use the chain, and it is what the chain was for. The knob that used to mean "off" no longer does, and the test that asserted it caught that immediately: drag_grayscale 0 now leaves drag_dim still dimming. Rather than couple them, the test became three — both off, each alone — which is better coverage of a two-knob effect than the single case was of a one-knob one.
Diffstat (limited to 'src/config.c')
-rw-r--r--src/config.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/config.c b/src/config.c
index 40a1cc9..6c1650c 100644
--- a/src/config.c
+++ b/src/config.c
@@ -131,6 +131,7 @@ void config_defaults(config_t *c) {
c->double_click_ms = 400;
c->dim_unfocused = 0;
c->drag_grayscale = 200;
+ c->drag_dim = 140;
c->status_bar = true;
c->focus_follows_mouse = true;
@@ -260,6 +261,8 @@ bool config_load(config_t *c, const char *path, char *err, size_t errcap) {
c->dim_unfocused);
c->drag_grayscale = (uint8_t)kdl_arg_int(kdl_child(root, "drag_grayscale"), 0,
c->drag_grayscale);
+ c->drag_dim =
+ (uint8_t)kdl_arg_int(kdl_child(root, "drag_dim"), 0, c->drag_dim);
const char *sh = kdl_arg(kdl_child(root, "shell"), 0, NULL);
if (sh) {