mirror of
https://github.com/swaywm/sway.git
synced 2026-04-06 07:15:44 -04:00
swaybar: add option to configure tray background
This commit is contained in:
parent
40aabb80c6
commit
03bd0c74c0
10 changed files with 35 additions and 0 deletions
|
|
@ -77,6 +77,7 @@ struct swaybar_config *init_config(void) {
|
|||
config->colors.binding_mode.text = 0xFFFFFFFF;
|
||||
|
||||
#if HAVE_TRAY
|
||||
config->colors.tray_background = 0x000000FF;
|
||||
config->tray_padding = 2;
|
||||
wl_list_init(&config->tray_bindings);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ static void ipc_parse_colors(
|
|||
{ "binding_mode_border", &config->colors.binding_mode.border },
|
||||
{ "binding_mode_bg", &config->colors.binding_mode.background },
|
||||
{ "binding_mode_text", &config->colors.binding_mode.text },
|
||||
{ "tray_background", &config->colors.tray_background },
|
||||
};
|
||||
|
||||
for (size_t i = 0; i < sizeof(properties) / sizeof(properties[i]); i++) {
|
||||
|
|
|
|||
|
|
@ -514,6 +514,9 @@ uint32_t render_sni(cairo_t *cairo, struct swaybar_output *output, double *x,
|
|||
cairo_set_operator(cairo, CAIRO_OPERATOR_OVER);
|
||||
|
||||
cairo_matrix_t scale_matrix;
|
||||
cairo_set_source_u32(cairo, output->bar->config->colors.tray_background);
|
||||
cairo_rectangle(cairo, *x, icon_y, size, size);
|
||||
cairo_fill(cairo);
|
||||
cairo_pattern_t *icon_pattern = cairo_pattern_create_for_surface(icon);
|
||||
// TODO: check cairo_pattern_status for "ENOMEM"
|
||||
cairo_matrix_init_scale(&scale_matrix, output->scale, output->scale);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue