From 54ebbd37f39e660a4af5e97c1f0d25b0777eb142 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Fri, 10 Nov 2000 16:26:36 +0000 Subject: Made the underline show up properly in the main menu bar. 2000-11-10 Christopher James Lahey * e-search-bar.c: Made the underline show up properly in the main menu bar. svn path=/trunk/; revision=6532 --- widgets/misc/e-search-bar.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'widgets/misc') diff --git a/widgets/misc/e-search-bar.c b/widgets/misc/e-search-bar.c index 302b8de917..d2370cc1f6 100644 --- a/widgets/misc/e-search-bar.c +++ b/widgets/misc/e-search-bar.c @@ -134,6 +134,19 @@ esb_menubar_activated(GtkWidget *widget, ESearchBar *esb) esb_menu_activated(esb, id); } +static void +esb_check_labels(GtkWidget *widget, gpointer data) +{ + if (GTK_IS_LABEL(widget)) { + char *text; + gtk_object_get(GTK_OBJECT(widget), + "label", &text, + NULL); + gtk_label_parse_uline(GTK_LABEL(widget), text); + g_free(text); + } +} + static void esb_pack_menubar(ESearchBar *esb, ESearchBarItem *items) { @@ -144,7 +157,10 @@ esb_pack_menubar(ESearchBar *esb, ESearchBarItem *items) for (i = 0; items[i].id != -1; i++) { GtkWidget *item; - item = gtk_menu_item_new_with_label (_(items[i].text)); + if (items[i].text) + item = gtk_menu_item_new_with_label (_(items[i].text)); + else + item = gtk_menu_item_new(); gtk_menu_append (GTK_MENU (menu), item); @@ -156,7 +172,8 @@ esb_pack_menubar(ESearchBar *esb, ESearchBarItem *items) } gtk_widget_show_all (menu); - menuitem = gnome_stock_menu_item(GNOME_STOCK_MENU_SEARCH, _("Search")); + menuitem = gnome_stock_menu_item(GNOME_STOCK_MENU_SEARCH, _("Sear_ch")); + e_container_foreach_leaf(GTK_CONTAINER(menuitem), esb_check_labels); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menuitem), menu); gtk_widget_show (menuitem); @@ -190,7 +207,10 @@ esb_pack_option_menu(ESearchBar *esb, ESearchBarItem *items) for (i = 0; items[i].id != -1; i++) { GtkWidget *item; - item = gtk_menu_item_new_with_label (_(items[i].text)); + if (items[i].text) + item = gtk_menu_item_new_with_label (_(items[i].text)); + else + item = gtk_menu_item_new(); gtk_menu_append (GTK_MENU (menu), item); -- cgit