ssd: add optional omnipresent button

This commit is contained in:
Andrew J. Hesford 2024-08-23 12:45:14 -04:00 committed by Consolatis
parent 186a07be9b
commit b7bccc8026
12 changed files with 165 additions and 52 deletions

View file

@ -89,7 +89,9 @@ match_button_by_name(struct title_button *b, const char *icon_name)
|| (b->type == LAB_SSD_BUTTON_ICONIFY && !strcmp(icon_name, "iconify"))
|| (b->type == LAB_SSD_BUTTON_CLOSE && !strcmp(icon_name, "close"))
|| (b->type == LAB_SSD_BUTTON_SHADE && !strcmp(icon_name, "shade"))
|| (b->type == LAB_SSD_BUTTON_SHADE && !strcmp(icon_name, "shade_toggled"));
|| (b->type == LAB_SSD_BUTTON_SHADE && !strcmp(icon_name, "shade_toggled"))
|| (b->type == LAB_SSD_BUTTON_OMNIPRESENT && !strcmp(icon_name, "desk"))
|| (b->type == LAB_SSD_BUTTON_OMNIPRESENT && !strcmp(icon_name, "desk_toggled"));
}
static enum corner
@ -263,6 +265,20 @@ load_buttons(struct theme *theme)
.active.rgba = theme->window_active_button_shade_unpressed_image_color,
.inactive.buffer = &theme->button_unshade_inactive_unpressed,
.inactive.rgba = theme->window_inactive_button_shade_unpressed_image_color,
}, {
.name = "desk",
.fallback_button = (const char[]){ 0x33, 0x33, 0x00, 0x00, 0x33, 0x33 },
.active.buffer = &theme->button_omnipresent_active_unpressed,
.active.rgba = theme->window_active_button_omnipresent_unpressed_image_color,
.inactive.buffer = &theme->button_omnipresent_inactive_unpressed,
.inactive.rgba = theme->window_inactive_button_omnipresent_unpressed_image_color,
}, {
.name = "desk_toggled",
.fallback_button = (const char[]){ 0x00, 0x1e, 0x1a, 0x16, 0x1e, 0x00 },
.active.buffer = &theme->button_exclusive_active_unpressed,
.active.rgba = theme->window_active_button_omnipresent_unpressed_image_color,
.inactive.buffer = &theme->button_exclusive_inactive_unpressed,
.inactive.rgba = theme->window_inactive_button_omnipresent_unpressed_image_color,
}, {
.name = "close",
.fallback_button = (const char[]){ 0x33, 0x3f, 0x1e, 0x1e, 0x3f, 0x33 },
@ -314,6 +330,21 @@ load_buttons(struct theme *theme)
.active.rgba = theme->window_active_button_shade_unpressed_image_color,
.inactive.buffer = &theme->button_unshade_inactive_hover,
.inactive.rgba = theme->window_inactive_button_shade_unpressed_image_color,
}, {
.name = "desk_hover",
/* no fallback (non-hover variant is used instead) */
.active.buffer = &theme->button_omnipresent_active_hover,
.active.rgba = theme->window_active_button_omnipresent_unpressed_image_color,
.inactive.buffer = &theme->button_omnipresent_inactive_hover,
.inactive.rgba = theme->window_inactive_button_omnipresent_unpressed_image_color,
}, {
.name = "desk_toggled_hover",
.alt_name = "desk_hover_toggled",
/* no fallback (non-hover variant is used instead) */
.active.buffer = &theme->button_exclusive_active_hover,
.active.rgba = theme->window_active_button_omnipresent_unpressed_image_color,
.inactive.buffer = &theme->button_exclusive_inactive_hover,
.inactive.rgba = theme->window_inactive_button_omnipresent_unpressed_image_color,
}, {
.name = "close_hover",
/* no fallback (non-hover variant is used instead) */
@ -545,6 +576,8 @@ theme_builtin(struct theme *theme, struct server *server)
theme->window_active_button_max_unpressed_image_color);
parse_hexstr("#000000",
theme->window_active_button_shade_unpressed_image_color);
parse_hexstr("#000000",
theme->window_active_button_omnipresent_unpressed_image_color);
parse_hexstr("#000000",
theme->window_active_button_close_unpressed_image_color);
parse_hexstr("#000000",
@ -555,6 +588,8 @@ theme_builtin(struct theme *theme, struct server *server)
theme->window_inactive_button_max_unpressed_image_color);
parse_hexstr("#000000",
theme->window_inactive_button_shade_unpressed_image_color);
parse_hexstr("#000000",
theme->window_inactive_button_omnipresent_unpressed_image_color);
parse_hexstr("#000000",
theme->window_inactive_button_close_unpressed_image_color);
@ -721,6 +756,8 @@ entry(struct theme *theme, const char *key, const char *value)
theme->window_active_button_max_unpressed_image_color);
parse_hexstr(value,
theme->window_active_button_shade_unpressed_image_color);
parse_hexstr(value,
theme->window_active_button_omnipresent_unpressed_image_color);
parse_hexstr(value,
theme->window_active_button_close_unpressed_image_color);
}
@ -733,6 +770,8 @@ entry(struct theme *theme, const char *key, const char *value)
theme->window_inactive_button_max_unpressed_image_color);
parse_hexstr(value,
theme->window_inactive_button_shade_unpressed_image_color);
parse_hexstr(value,
theme->window_inactive_button_omnipresent_unpressed_image_color);
parse_hexstr(value,
theme->window_inactive_button_close_unpressed_image_color);
}
@ -754,6 +793,10 @@ entry(struct theme *theme, const char *key, const char *value)
parse_hexstr(value,
theme->window_active_button_shade_unpressed_image_color);
}
if (match_glob(key, "window.active.button.omnipresent.unpressed.image.color")) {
parse_hexstr(value,
theme->window_active_button_omnipresent_unpressed_image_color);
}
if (match_glob(key, "window.active.button.close.unpressed.image.color")) {
parse_hexstr(value,
theme->window_active_button_close_unpressed_image_color);
@ -774,6 +817,10 @@ entry(struct theme *theme, const char *key, const char *value)
parse_hexstr(value,
theme->window_inactive_button_shade_unpressed_image_color);
}
if (match_glob(key, "window.inactive.button.omnipresent.unpressed.image.color")) {
parse_hexstr(value,
theme->window_inactive_button_omnipresent_unpressed_image_color);
}
if (match_glob(key, "window.inactive.button.close.unpressed.image.color")) {
parse_hexstr(value,
theme->window_inactive_button_close_unpressed_image_color);
@ -1494,6 +1541,8 @@ theme_finish(struct theme *theme)
zdrop(&theme->button_restore_active_unpressed);
zdrop(&theme->button_shade_active_unpressed);
zdrop(&theme->button_unshade_active_unpressed);
zdrop(&theme->button_omnipresent_active_unpressed);
zdrop(&theme->button_exclusive_active_unpressed);
zdrop(&theme->button_iconify_active_unpressed);
zdrop(&theme->button_menu_active_unpressed);
@ -1502,6 +1551,8 @@ theme_finish(struct theme *theme)
zdrop(&theme->button_restore_inactive_unpressed);
zdrop(&theme->button_shade_inactive_unpressed);
zdrop(&theme->button_unshade_inactive_unpressed);
zdrop(&theme->button_omnipresent_inactive_unpressed);
zdrop(&theme->button_exclusive_inactive_unpressed);
zdrop(&theme->button_iconify_inactive_unpressed);
zdrop(&theme->button_menu_inactive_unpressed);
@ -1510,6 +1561,8 @@ theme_finish(struct theme *theme)
zdrop(&theme->button_restore_active_hover);
zdrop(&theme->button_shade_active_hover);
zdrop(&theme->button_unshade_active_hover);
zdrop(&theme->button_omnipresent_active_hover);
zdrop(&theme->button_exclusive_active_hover);
zdrop(&theme->button_iconify_active_hover);
zdrop(&theme->button_menu_active_hover);
@ -1518,6 +1571,8 @@ theme_finish(struct theme *theme)
zdrop(&theme->button_restore_inactive_hover);
zdrop(&theme->button_shade_inactive_hover);
zdrop(&theme->button_unshade_inactive_hover);
zdrop(&theme->button_omnipresent_inactive_hover);
zdrop(&theme->button_exclusive_inactive_hover);
zdrop(&theme->button_iconify_inactive_hover);
zdrop(&theme->button_menu_inactive_hover);