mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-04 04:06:06 -05:00
config+render: move alpha-mode to colors.alpha-mode, fix cursor handling
Move main.alpha-mode to colors.alpha-mode. Fix (inverted) cursor handling, by always using the bg color without alpha. Do a minor optimization, where we don't even lock at colors.alpha-mode if there's no transparency configured.
This commit is contained in:
parent
bacfba135d
commit
d2d4f53861
3 changed files with 74 additions and 78 deletions
20
config.c
20
config.c
|
|
@ -1095,15 +1095,6 @@ parse_section_main(struct context *ctx)
|
|||
return true;
|
||||
}
|
||||
|
||||
else if (strcmp(key, "alpha-mode") == 0) {
|
||||
_Static_assert(sizeof(conf->alpha_mode) == sizeof(int),
|
||||
"enum is not 32-bit");
|
||||
return value_to_enum(
|
||||
ctx,
|
||||
(const char *[]){"default", "matching", "all", NULL},
|
||||
(int *)&conf->alpha_mode);
|
||||
}
|
||||
|
||||
else {
|
||||
LOG_CONTEXTUAL_ERR("not a valid option: %s", key);
|
||||
return false;
|
||||
|
|
@ -1490,6 +1481,15 @@ parse_section_colors(struct context *ctx)
|
|||
return true;
|
||||
}
|
||||
|
||||
else if (strcmp(key, "alpha-mode") == 0) {
|
||||
_Static_assert(sizeof(conf->colors.alpha_mode) == sizeof(int),
|
||||
"enum is not 32-bit");
|
||||
|
||||
return value_to_enum(
|
||||
ctx,
|
||||
(const char *[]){"default", "matching", "all", NULL},
|
||||
(int *)&conf->colors.alpha_mode);
|
||||
}
|
||||
|
||||
else {
|
||||
LOG_CONTEXTUAL_ERR("not valid option");
|
||||
|
|
@ -3347,13 +3347,13 @@ config_load(struct config *conf, const char *conf_path,
|
|||
},
|
||||
.multiplier = 3.,
|
||||
},
|
||||
.alpha_mode = ALPHA_MODE_DEFAULT,
|
||||
.colors = {
|
||||
.fg = default_foreground,
|
||||
.bg = default_background,
|
||||
.flash = 0x7f7f00,
|
||||
.flash_alpha = 0x7fff,
|
||||
.alpha = 0xffff,
|
||||
.alpha_mode = ALPHA_MODE_DEFAULT,
|
||||
.selection_fg = 0x80000000, /* Use default bg */
|
||||
.selection_bg = 0x80000000, /* Use default fg */
|
||||
.use_custom = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue