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

@ -788,6 +788,27 @@ render_cell(struct terminal *term, pixman_image_t *pix,
alpha = term->colors.alpha;
}
}
if (!term->window->is_fullscreen) {
switch (term->conf->alpha_mode) {
case ALPHA_MODE_DEFAULT: {
if (cell->attrs.bg_src == COLOR_DEFAULT) {
alpha = term->colors.alpha;
}
break;
}
case ALPHA_MODE_MATCHING: {
if (cell->attrs.bg == term->colors.bg) {
alpha = term->colors.alpha;
}
break;
}
case ALPHA_MODE_ALL: {
alpha = term->colors.alpha;
break;
}
}
}
}
if (unlikely(is_selected && _fg == _bg)) {