diff options
| author | user <user@clank> | 2026-08-14 19:14:29 +0200 |
|---|---|---|
| committer | user <user@clank> | 2026-08-14 19:14:29 +0200 |
| commit | e75eecfc64adbf5fae0f4ddc3eca1dae41028fa2 (patch) | |
| tree | 21b114e4b5a517b9762e25a3057504b69c9e38c8 /src/config.c | |
| parent | sl0ppty: give the scroll arrow room to breathe (diff) | |
| download | slosh-e75eecfc64adbf5fae0f4ddc3eca1dae41028fa2.tar.gz slosh-e75eecfc64adbf5fae0f4ddc3eca1dae41028fa2.tar.xz slosh-e75eecfc64adbf5fae0f4ddc3eca1dae41028fa2.zip | |
sl0ppty: one theme name per decision, and a tab you can see
The count, since it was asked: no hardcoded colours at all in the drawing code.
Every colour already came from the config. The problem was the other way round
— six names were serving about thirty decisions, so the names were the thing
that was hardcoded. frame_focus was the focused frame *and* the split guide
*and* the resize handle *and* the tab hover *and* a collapsed row under the
pointer. Recolouring one recoloured five.
There are thirty-five entries now, one per surface, each documented in
config.kdl by being its own default. Several still share a value: that is a
statement that they look right together, not that they are the same thing, and
the difference only matters the first time someone wants to change one of them.
The tab you are in is filled rather than merely bold, which was the ask. Bold
alone is easy to miss on a strip of short labels, and it was the only thing
distinguishing the tab you were in from the four you were not.
That immediately raised a question the old scheme could not ask: what does
hovering the active tab look like, when it already has the strongest treatment
on the strip? Keeping its fill and brightening its text, because it is still
the tab you are in and clicking it does nothing. My first version gave it no
hover at all, which reads as the hover being broken rather than as the click
being pointless.
Three surfaces were still borrowing a name that did not describe them: the
in-place rename editor was wearing the button colours, a pane's OSC status text
and a suspended pane's hint were wearing the frame's. They have their own now.
Diffstat (limited to 'src/config.c')
| -rw-r--r-- | src/config.c | 92 |
1 files changed, 83 insertions, 9 deletions
diff --git a/src/config.c b/src/config.c index 9fd2cd3..11585d7 100644 --- a/src/config.c +++ b/src/config.c @@ -202,13 +202,56 @@ void config_defaults(config_t *c) { 140); c->state_n[PSTATE_DROP_HOVER] = 2; - c->frame_focus = rgb(0xff, 0x5f, 0xd7); - c->frame_idle = rgb(0x45, 0x45, 0x4a); - c->title_focus = rgb(0xff, 0xff, 0xff); - c->button_fg = rgb(0x14, 0x14, 0x18); - c->button_bg = rgb(0xff, 0x5f, 0xd7); + const color_t accent = rgb(0xff, 0x5f, 0xd7); + const color_t ink = rgb(0x14, 0x14, 0x18); + const color_t dim = rgb(0x45, 0x45, 0x4a); + const color_t bright = rgb(0xff, 0xff, 0xff); + + c->frame_focus = accent; + c->frame_idle = dim; + c->title_focus = bright; + c->title_idle = dim; + + c->button_fg = ink; + c->button_bg = accent; c->button_bg_idle = rgb(0x55, 0x55, 0x5c); + c->guide = accent; + c->resize = accent; + c->drop_target = accent; + + c->scroll_fg = ink; + c->scroll_bg = accent; + + c->header = dim; + c->header_hover = accent; + c->header_hover_title = bright; + + /* The tab you are in is stated in colour, not only in weight: bold alone is + * easy to miss on a strip of short labels. */ + c->tab_active_fg = ink; + c->tab_active_bg = accent; + c->tab_active_hover_fg = bright; + c->tab_idle = dim; + c->tab_hover = accent; + c->prefix_fg = ink; + c->prefix_bg = accent; + c->tab_count = dim; + + c->status = dim; + c->status_state = bright; + + c->finder_fg = bright; + c->finder_bg = dim; + c->finder_sel_fg = ink; + c->finder_sel_bg = accent; + + c->rename_fg = ink; + c->rename_bg = accent; + + c->toast_fg = ink; + c->toast_bg = accent; + c->prefix_key = GHOSTTY_KEY_A; c->prefix_mods = MOD_CTRL; @@ -376,10 +419,41 @@ bool config_load(config_t *c, const char *path, char *err, size_t errcap) { const char *name; color_t *slot; } colors[] = { - {"default_fg", &c->default_fg}, {"default_bg", &c->default_bg}, - {"frame_focus", &c->frame_focus}, {"frame_idle", &c->frame_idle}, - {"title", &c->title_focus}, {"button_fg", &c->button_fg}, - {"button_bg", &c->button_bg}, {"button_bg_idle", &c->button_bg_idle}, + {"default_fg", &c->default_fg}, + {"default_bg", &c->default_bg}, + {"frame_focus", &c->frame_focus}, + {"frame_idle", &c->frame_idle}, + {"title", &c->title_focus}, + {"title_idle", &c->title_idle}, + {"button_fg", &c->button_fg}, + {"button_bg", &c->button_bg}, + {"button_bg_idle", &c->button_bg_idle}, + {"guide", &c->guide}, + {"resize", &c->resize}, + {"drop_target", &c->drop_target}, + {"scroll_fg", &c->scroll_fg}, + {"scroll_bg", &c->scroll_bg}, + {"header", &c->header}, + {"header_hover", &c->header_hover}, + {"header_hover_title", &c->header_hover_title}, + {"tab_active_fg", &c->tab_active_fg}, + {"tab_active_bg", &c->tab_active_bg}, + {"tab_active_hover_fg", &c->tab_active_hover_fg}, + {"tab_idle", &c->tab_idle}, + {"tab_hover", &c->tab_hover}, + {"prefix_fg", &c->prefix_fg}, + {"prefix_bg", &c->prefix_bg}, + {"tab_count", &c->tab_count}, + {"status", &c->status}, + {"status_state", &c->status_state}, + {"finder_fg", &c->finder_fg}, + {"finder_bg", &c->finder_bg}, + {"finder_sel_fg", &c->finder_sel_fg}, + {"finder_sel_bg", &c->finder_sel_bg}, + {"rename_fg", &c->rename_fg}, + {"rename_bg", &c->rename_bg}, + {"toast_fg", &c->toast_fg}, + {"toast_bg", &c->toast_bg}, }; for (size_t i = 0; i < sizeof colors / sizeof *colors; i++) { const char *v = kdl_arg(kdl_child(theme, colors[i].name), 0, NULL); |
