config: add alpha_mode option

This commit is contained in:
Fazzi 2023-10-09 18:47:09 +01:00 committed by Daniel Eklöf
parent 9a6227acb3
commit 5f83278afd
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 38 additions and 0 deletions

View file

@ -1095,6 +1095,15 @@ 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;
@ -3338,6 +3347,7 @@ config_load(struct config *conf, const char *conf_path,
},
.multiplier = 3.,
},
.alpha_mode = ALPHA_MODE_DEFAULT,
.colors = {
.fg = default_foreground,
.bg = default_background,