From 650cfa18efdc38164600959e90fdaa50f58910e4 Mon Sep 17 00:00:00 2001 From: "feeptr@codeberg.org" Date: Mon, 27 Sep 2021 19:05:40 +0000 Subject: [PATCH 1/3] config, render: scrollback indicator: allow configuring scrollback indicator colors --- config.c | 13 +++++++++++++ config.h | 6 ++++++ render.c | 9 ++++++++- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/config.c b/config.c index 3448cab6..a213075b 100644 --- a/config.c +++ b/config.c @@ -1324,6 +1324,18 @@ parse_section_colors(const char *key, const char *value, struct config *conf, return true; } + else if (strcmp(key, "scrollback-indicator") == 0) { + if (!str_to_two_colors( + value, &conf->colors.scrollback_indicator.fg, &conf->colors.scrollback_indicator.bg, + false, conf, path, lineno, "colors", "scrollback-indicator")) + { + return false; + } + + conf->colors.use_custom.scrollback_indicator = true; + return true; + } + else if (strcmp(key, "urls") == 0) { if (!str_to_color(value, &conf->colors.url, false, conf, path, lineno, "colors", "urls")) @@ -2926,6 +2938,7 @@ config_load(struct config *conf, const char *conf_path, .use_custom = { .selection = false, .jump_label = false, + .scrollback_indicator = false, .url = false, }, }, diff --git a/config.h b/config.h index 66db5d2f..db4bc275 100644 --- a/config.h +++ b/config.h @@ -163,9 +163,15 @@ struct config { uint32_t bg; } jump_label; + struct { + uint32_t fg; + uint32_t bg; + } scrollback_indicator; + struct { bool selection:1; bool jump_label:1; + bool scrollback_indicator:1; bool url:1; } use_custom; } colors; diff --git a/render.c b/render.c index c4b1b4c8..9a5291e4 100644 --- a/render.c +++ b/render.c @@ -2147,12 +2147,19 @@ render_scrollback_position(struct terminal *term) wl_subsurface_set_position( win->scrollback_indicator.sub, x / scale, y / scale); + uint32_t fg = term->colors.table[0]; + uint32_t bg = term->colors.table[8 + 4]; + if (term->conf->colors.use_custom.scrollback_indicator) { + fg = term->conf->colors.scrollback_indicator.fg; + bg = term->conf->colors.scrollback_indicator.bg; + } + render_osd( term, win->scrollback_indicator.surf, win->scrollback_indicator.sub, term->fonts[0], buf, text, - term->colors.table[0], 0xffu << 24 | term->colors.table[8 + 4], + fg, 0xffu << 24 | bg, width - margin - wcslen(text) * term->cell_width, margin); } From 7eea97b65933239a30c6245c6fa1e2463ce1a1ae Mon Sep 17 00:00:00 2001 From: "feeptr@codeberg.org" Date: Mon, 27 Sep 2021 19:39:29 +0000 Subject: [PATCH 2/3] doc: document indicator-color --- doc/foot.ini.5.scd | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/doc/foot.ini.5.scd b/doc/foot.ini.5.scd index 26116d62..b242e8fb 100644 --- a/doc/foot.ini.5.scd +++ b/doc/foot.ini.5.scd @@ -513,6 +513,13 @@ _alpha_ option. colors to use when rendering jump labels in URL mode. Default: _regular0 regular3_. +*scrollback-indicator* + Two RRGGBB values specifying the foreground (text) and background + (indicator itself) colors for the scrollback indicator. + + Default: first regular color (black) for foreground, + and fifth bright color (light blue) for background. + *urls* Color to use for the underline used to highlight URLs in URL mode. Default: _regular3_. From 85cc05ba2294ba30fbb95d51f77e62263e7b45bd Mon Sep 17 00:00:00 2001 From: "feeptr@codeberg.org" Date: Fri, 8 Oct 2021 02:34:53 +0000 Subject: [PATCH 3/3] changelog: list scrollback.indicator-color addition --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a9b57ff0..a400d9d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,6 +38,8 @@ * `notify-focus-inhibit` boolean option, which can be used to control whether desktop notifications should be inhibited when the terminal has keyboard focus +* `colors.scrollback-indicator` color-pair option, which specifies foreground + and background colors for the scrollback indicator. ### Changed ### Deprecated