mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-15 05:33:58 -04:00
config: add csd.button-color option
This option controls the foreground color of the minimize/maximize/close buttons. I.e. the color used to draw the minimize/maximize/close glyphs. It defaults to default background color.
This commit is contained in:
parent
1a755d0da2
commit
7334b53d83
6 changed files with 43 additions and 10 deletions
22
render.c
22
render.c
|
|
@ -1580,10 +1580,24 @@ render_csd_border(struct terminal *term, enum csd_surface surf_idx)
|
|||
csd_commit(term, surf, buf);
|
||||
}
|
||||
|
||||
static pixman_color_t
|
||||
get_csd_button_fg_color(const struct config *conf)
|
||||
{
|
||||
uint32_t _color = conf->colors.bg;
|
||||
uint16_t alpha = 0xffff;
|
||||
|
||||
if (conf->csd.color.buttons_set) {
|
||||
_color = conf->csd.color.buttons;
|
||||
alpha = _color >> 24 | (_color >> 24 << 8);
|
||||
}
|
||||
|
||||
return color_hex_to_pixman_with_alpha(_color, alpha);
|
||||
}
|
||||
|
||||
static void
|
||||
render_csd_button_minimize(struct terminal *term, struct buffer *buf)
|
||||
{
|
||||
pixman_color_t color = color_hex_to_pixman(term->conf->colors.bg);
|
||||
pixman_color_t color = get_csd_button_fg_color(term->conf);
|
||||
pixman_image_t *src = pixman_image_create_solid_fill(&color);
|
||||
|
||||
const int max_height = buf->height / 2;
|
||||
|
|
@ -1628,7 +1642,7 @@ static void
|
|||
render_csd_button_maximize_maximized(
|
||||
struct terminal *term, struct buffer *buf)
|
||||
{
|
||||
pixman_color_t color = color_hex_to_pixman(term->conf->colors.bg);
|
||||
pixman_color_t color = get_csd_button_fg_color(term->conf);
|
||||
pixman_image_t *src = pixman_image_create_solid_fill(&color);
|
||||
|
||||
const int max_height = buf->height / 3;
|
||||
|
|
@ -1656,7 +1670,7 @@ static void
|
|||
render_csd_button_maximize_window(
|
||||
struct terminal *term, struct buffer *buf)
|
||||
{
|
||||
pixman_color_t color = color_hex_to_pixman(term->conf->colors.bg);
|
||||
pixman_color_t color = get_csd_button_fg_color(term->conf);
|
||||
pixman_image_t *src = pixman_image_create_solid_fill(&color);
|
||||
|
||||
const int max_height = buf->height / 2;
|
||||
|
|
@ -1710,7 +1724,7 @@ render_csd_button_maximize(struct terminal *term, struct buffer *buf)
|
|||
static void
|
||||
render_csd_button_close(struct terminal *term, struct buffer *buf)
|
||||
{
|
||||
pixman_color_t color = color_hex_to_pixman(term->conf->colors.bg);
|
||||
pixman_color_t color = get_csd_button_fg_color(term->conf);
|
||||
pixman_image_t *src = pixman_image_create_solid_fill(&color);
|
||||
|
||||
const int max_height = buf->height / 3;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue