mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-12 05:34:01 -04:00
Merge branch 'configurable-indicator-colors'
This commit is contained in:
commit
b3bc7ec413
5 changed files with 36 additions and 1 deletions
|
|
@ -38,6 +38,8 @@
|
||||||
* `notify-focus-inhibit` boolean option, which can be used to control whether
|
* `notify-focus-inhibit` boolean option, which can be used to control whether
|
||||||
desktop notifications should be inhibited when the terminal has keyboard
|
desktop notifications should be inhibited when the terminal has keyboard
|
||||||
focus
|
focus
|
||||||
|
* `colors.scrollback-indicator` color-pair option, which specifies foreground
|
||||||
|
and background colors for the scrollback indicator.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
|
|
||||||
13
config.c
13
config.c
|
|
@ -1324,6 +1324,18 @@ parse_section_colors(const char *key, const char *value, struct config *conf,
|
||||||
return true;
|
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) {
|
else if (strcmp(key, "urls") == 0) {
|
||||||
if (!str_to_color(value, &conf->colors.url, false,
|
if (!str_to_color(value, &conf->colors.url, false,
|
||||||
conf, path, lineno, "colors", "urls"))
|
conf, path, lineno, "colors", "urls"))
|
||||||
|
|
@ -2926,6 +2938,7 @@ config_load(struct config *conf, const char *conf_path,
|
||||||
.use_custom = {
|
.use_custom = {
|
||||||
.selection = false,
|
.selection = false,
|
||||||
.jump_label = false,
|
.jump_label = false,
|
||||||
|
.scrollback_indicator = false,
|
||||||
.url = false,
|
.url = false,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
6
config.h
6
config.h
|
|
@ -163,9 +163,15 @@ struct config {
|
||||||
uint32_t bg;
|
uint32_t bg;
|
||||||
} jump_label;
|
} jump_label;
|
||||||
|
|
||||||
|
struct {
|
||||||
|
uint32_t fg;
|
||||||
|
uint32_t bg;
|
||||||
|
} scrollback_indicator;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
bool selection:1;
|
bool selection:1;
|
||||||
bool jump_label:1;
|
bool jump_label:1;
|
||||||
|
bool scrollback_indicator:1;
|
||||||
bool url:1;
|
bool url:1;
|
||||||
} use_custom;
|
} use_custom;
|
||||||
} colors;
|
} colors;
|
||||||
|
|
|
||||||
|
|
@ -513,6 +513,13 @@ _alpha_ option.
|
||||||
colors to use when rendering jump labels in URL mode. Default:
|
colors to use when rendering jump labels in URL mode. Default:
|
||||||
_regular0 regular3_.
|
_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*
|
*urls*
|
||||||
Color to use for the underline used to highlight URLs in URL
|
Color to use for the underline used to highlight URLs in URL
|
||||||
mode. Default: _regular3_.
|
mode. Default: _regular3_.
|
||||||
|
|
|
||||||
9
render.c
9
render.c
|
|
@ -2147,12 +2147,19 @@ render_scrollback_position(struct terminal *term)
|
||||||
wl_subsurface_set_position(
|
wl_subsurface_set_position(
|
||||||
win->scrollback_indicator.sub, x / scale, y / scale);
|
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(
|
render_osd(
|
||||||
term,
|
term,
|
||||||
win->scrollback_indicator.surf,
|
win->scrollback_indicator.surf,
|
||||||
win->scrollback_indicator.sub,
|
win->scrollback_indicator.sub,
|
||||||
term->fonts[0], buf, text,
|
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);
|
width - margin - wcslen(text) * term->cell_width, margin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue