diff --git a/config.c b/config.c index 74cff1f3..285bc889 100644 --- a/config.c +++ b/config.c @@ -2281,7 +2281,9 @@ config_load(struct config *conf, const char *conf_path, .alpha = 0xffff, .selection_fg = 0x80000000, /* Use default bg */ .selection_bg = 0x80000000, /* Use default fg */ - .selection_uses_custom_colors = false, + .use_custom = { + .selection = false, + }, }, .cursor = { @@ -2378,7 +2380,7 @@ config_load(struct config *conf, const char *conf_path, ret = parse_config_file(f, conf, conf_file.path, errors_are_fatal); fclose(f); - conf->colors.selection_uses_custom_colors = + conf->colors.use_custom.selection = conf->colors.selection_fg >> 24 == 0 && conf->colors.selection_bg >> 24 == 0; diff --git a/config.h b/config.h index d6ad2b24..f8ebb572 100644 --- a/config.h +++ b/config.h @@ -139,7 +139,10 @@ struct config { uint16_t alpha; uint32_t selection_fg; uint32_t selection_bg; - bool selection_uses_custom_colors; + + struct { + bool selection:1; + } use_custom; } colors; struct { diff --git a/render.c b/render.c index 451b0ff3..8415ac81 100644 --- a/render.c +++ b/render.c @@ -412,7 +412,7 @@ render_cell(struct terminal *term, pixman_image_t *pix, uint32_t _fg = 0; uint32_t _bg = 0; - if (is_selected && term->conf->colors.selection_uses_custom_colors) { + if (is_selected && term->conf->colors.use_custom.selection) { _fg = term->conf->colors.selection_fg; _bg = term->conf->colors.selection_bg; } else {