aboutsummaryrefslogtreecommitdiff
path: root/config.c
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2025-04-14 14:58:23 +0000
committerDaniel Eklöf <daniel@ekloef.se>2025-04-14 14:58:23 +0000
commitd2d4f538619177bc3af6c09e2465272f564ee780 (patch)
tree63b0f28db211a4dc0d1346f82179f20641bc588d /config.c
parentchangelog: move 'alpha-mode' to next-release (diff)
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.
Diffstat (limited to 'config.c')
-rw-r--r--config.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/config.c b/config.c
index aa52b89b..347cc1ec 100644
--- a/config.c
+++ b/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 = {