From f088008e452f5d58d332d777df09a176855c198d Mon Sep 17 00:00:00 2001 From: B Stack Date: Wed, 5 Feb 2020 17:49:02 -0500 Subject: accept "-----" as a separator in the menu spec --- mktrayicon.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'mktrayicon.c') diff --git a/mktrayicon.c b/mktrayicon.c index a0fed9a..fe235f4 100644 --- a/mktrayicon.c +++ b/mktrayicon.c @@ -395,10 +395,15 @@ outer: // Now create the menu item widgets and attach them on the menu for (int i = 0; i < menusize; i++) { - GtkWidget *w = gtk_menu_item_new_with_label(onmenu[i].name); - gtk_menu_shell_append(GTK_MENU_SHELL(menu), w); - g_signal_connect(G_OBJECT(w), "activate", G_CALLBACK(click_menu_item), - NULL); + if (strncmp(onmenu[i].name, "-----", 5) == 0) { + GtkWidget *w = gtk_separator_menu_item_new() ; + gtk_menu_shell_append(GTK_MENU_SHELL(menu), w); + } else { + GtkWidget *w = gtk_menu_item_new_with_label(onmenu[i].name); + gtk_menu_shell_append(GTK_MENU_SHELL(menu), w); + g_signal_connect(G_OBJECT(w), "activate", G_CALLBACK(click_menu_item), + NULL); + } } gtk_widget_show_all(menu); free(param); -- cgit