From 004b817647d0acf51a6e7232d78c867990cc1340 Mon Sep 17 00:00:00 2001 From: Scarcely There Date: Sun, 20 Nov 2022 23:38:17 -0600 Subject: [PATCH] ssd: Inactive window button icons now follow theme color I was making a theme and discovered only the active window button icon color was taking effect. The pixmaps were being created in both the active and inactive cases, but inactive pixmaps were never added to the SSD scene graph. --- src/ssd/ssd_titlebar.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/ssd/ssd_titlebar.c b/src/ssd/ssd_titlebar.c index fd7d820d..983a3718 100644 --- a/src/ssd/ssd_titlebar.c +++ b/src/ssd/ssd_titlebar.c @@ -27,6 +27,11 @@ ssd_titlebar_create(struct view *view) struct wlr_buffer *corner_top_left; struct wlr_buffer *corner_top_right; + struct wlr_buffer *menu_button_unpressed; + struct wlr_buffer *iconify_button_unpressed; + struct wlr_buffer *maximize_button_unpressed; + struct wlr_buffer *close_button_unpressed; + struct ssd_sub_tree *subtree; FOR_EACH_STATE(view, subtree) { subtree->tree = wlr_scene_tree_create(view->ssd.tree); @@ -36,10 +41,18 @@ ssd_titlebar_create(struct view *view) color = theme->window_active_title_bg_color; corner_top_left = &theme->corner_top_left_active_normal->base; corner_top_right = &theme->corner_top_right_active_normal->base; + menu_button_unpressed = &theme->xbm_menu_active_unpressed->base; + iconify_button_unpressed = &theme->xbm_iconify_active_unpressed->base; + close_button_unpressed = &theme->xbm_close_active_unpressed->base; + maximize_button_unpressed = &theme->xbm_maximize_active_unpressed->base; } else { color = theme->window_inactive_title_bg_color; corner_top_left = &theme->corner_top_left_inactive_normal->base; corner_top_right = &theme->corner_top_right_inactive_normal->base; + menu_button_unpressed = &theme->xbm_menu_inactive_unpressed->base; + iconify_button_unpressed = &theme->xbm_iconify_inactive_unpressed->base; + maximize_button_unpressed = &theme->xbm_maximize_inactive_unpressed->base; + close_button_unpressed = &theme->xbm_close_inactive_unpressed->base; wlr_scene_node_set_enabled(&parent->node, false); } wl_list_init(&subtree->parts); @@ -51,16 +64,16 @@ ssd_titlebar_create(struct view *view) /* Buttons */ add_scene_button_corner(&subtree->parts, LAB_SSD_BUTTON_WINDOW_MENU, LAB_SSD_PART_CORNER_TOP_LEFT, parent, - corner_top_left, &theme->xbm_menu_active_unpressed->base, 0, view); + corner_top_left, menu_button_unpressed, 0, view); add_scene_button(&subtree->parts, LAB_SSD_BUTTON_ICONIFY, parent, - color, &theme->xbm_iconify_active_unpressed->base, + color, iconify_button_unpressed, width - BUTTON_WIDTH * 3, view); add_scene_button(&subtree->parts, LAB_SSD_BUTTON_MAXIMIZE, parent, - color, &theme->xbm_maximize_active_unpressed->base, + color, maximize_button_unpressed, width - BUTTON_WIDTH * 2, view); add_scene_button_corner(&subtree->parts, LAB_SSD_BUTTON_CLOSE, LAB_SSD_PART_CORNER_TOP_RIGHT, parent, - corner_top_right, &theme->xbm_close_active_unpressed->base, + corner_top_right, close_button_unpressed, width - BUTTON_WIDTH * 1, view); } FOR_EACH_END ssd_update_title(view);