diff --git a/include/theme.h b/include/theme.h index c6893ea2..c2c7e8be 100644 --- a/include/theme.h +++ b/include/theme.h @@ -29,6 +29,8 @@ struct theme_snapping_overlay { }; enum lab_button_state { + LAB_BS_DEFAULT = 0, + LAB_BS_HOVERD = 1 << 0, LAB_BS_TOGGLED = 1 << 1, LAB_BS_ROUNDED = 1 << 2, diff --git a/src/ssd/ssd-part.c b/src/ssd/ssd-part.c index fba803e3..b9c09c3e 100644 --- a/src/ssd/ssd-part.c +++ b/src/ssd/ssd-part.c @@ -100,7 +100,8 @@ add_scene_button(struct wl_list *part_list, enum ssd_part_type type, /* Icons */ struct wlr_scene_node *nodes[LAB_BS_ALL + 1] = {0}; - for (uint8_t state_set = 0; state_set <= LAB_BS_ALL; state_set++) { + for (uint8_t state_set = LAB_BS_DEFAULT; + state_set <= LAB_BS_ALL; state_set++) { if (!imgs[state_set]) { continue; } diff --git a/src/ssd/ssd-titlebar.c b/src/ssd/ssd-titlebar.c index 60c22b45..9eccc3ae 100644 --- a/src/ssd/ssd-titlebar.c +++ b/src/ssd/ssd-titlebar.c @@ -127,7 +127,8 @@ update_button_state(struct ssd_button *button, enum lab_button_state state, button->state_set &= ~state; } /* Switch the displayed icon buffer to the new one */ - for (uint8_t state_set = 0; state_set <= LAB_BS_ALL; state_set++) { + for (uint8_t state_set = LAB_BS_DEFAULT; + state_set <= LAB_BS_ALL; state_set++) { if (!button->nodes[state_set]) { continue; } @@ -626,7 +627,8 @@ ssd_update_window_icon(struct ssd *ssd) /* Replace all the buffers in the button with the window icon */ struct ssd_button *button = node_ssd_button_from_node(part->node); - for (uint8_t state_set = 0; state_set <= LAB_BS_ALL; state_set++) { + for (uint8_t state_set = LAB_BS_DEFAULT; + state_set <= LAB_BS_ALL; state_set++) { struct wlr_scene_node *node = button->nodes[state_set]; if (node) { struct scaled_img_buffer *img_buffer = diff --git a/src/theme.c b/src/theme.c index b0ebdf5f..cb7809a7 100644 --- a/src/theme.c +++ b/src/theme.c @@ -1531,8 +1531,8 @@ theme_finish(struct theme *theme) { for (enum ssd_part_type type = LAB_SSD_BUTTON_FIRST; type <= LAB_SSD_BUTTON_LAST; type++) { - for (uint8_t state_set = 0; state_set <= LAB_BS_ALL; - state_set++) { + for (uint8_t state_set = LAB_BS_DEFAULT; + state_set <= LAB_BS_ALL; state_set++) { destroy_img(&theme->window[THEME_INACTIVE] .button_imgs[type][state_set]); destroy_img(&theme->window[THEME_ACTIVE]