all repos — tint2 @ 63dd4a3e6cd2e7e0079a4e083c6f4fbc3d689eb7

fork of the tint2 desktop panel for my custom setup - only minimized windows across all desktops for the taskbar

Button: make sure icon is optional
o9000 mrovi9000@gmail.com
commit

63dd4a3e6cd2e7e0079a4e083c6f4fbc3d689eb7

parent

a7fc86cfbb746d25db6648fa10d74f6be92ef893

2 files changed, 8 insertions(+), 3 deletions(-)

jump to
M src/button/button.csrc/button/button.c

@@ -207,8 +207,13 @@ free_icon(button->frontend->icon);

free_icon(button->frontend->icon_hover); free_icon(button->frontend->icon_pressed); button->frontend->icon = NULL; + button->frontend->icon_hover = NULL; + button->frontend->icon_pressed = NULL; button->frontend->icon_load_size = button->frontend->iconw; + + if (!button->backend->icon_name) + return; char *new_icon_path = get_icon_path(icon_theme_wrapper, button->backend->icon_name, button->frontend->iconw, TRUE); if (new_icon_path)
M src/config.csrc/config.c

@@ -750,14 +750,14 @@

/* Button */ else if (strcmp(key, "button") == 0) { panel_config.button_list = g_list_append(panel_config.button_list, create_button()); - } else if (strcmp(key, "button_icon") == 0) { + } else if (strcmp(key, "button_icon") == 0 && strlen(value)) { Button *button = get_or_create_last_button(); button->backend->icon_name = strdup(value); - } else if (strcmp(key, "button_text") == 0) { + } else if (strcmp(key, "button_text") == 0 && strlen(value)) { Button *button = get_or_create_last_button(); free_and_null(button->backend->text); button->backend->text = strdup(value); - } else if (strcmp(key, "button_tooltip") == 0) { + } else if (strcmp(key, "button_tooltip") == 0 && strlen(value)) { Button *button = get_or_create_last_button(); free_and_null(button->backend->tooltip); button->backend->tooltip = strdup(value);