diff --git a/src/fe-gtk/chanlist.c b/src/fe-gtk/chanlist.c index 79e94c54..217f5970 100644 --- a/src/fe-gtk/chanlist.c +++ b/src/fe-gtk/chanlist.c @@ -136,7 +136,7 @@ chanlist_icon_menu_item (const char *label, const char *icon_name, item = gtk_menu_item_new (); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); - image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU); + image = icon_name ? gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU) : NULL; label_widget = gtk_label_new_with_mnemonic (label); if (image) gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0); diff --git a/src/fe-gtk/menu.c b/src/fe-gtk/menu.c index 3e7a1838..3bc6d20b 100644 --- a/src/fe-gtk/menu.c +++ b/src/fe-gtk/menu.c @@ -2004,33 +2004,43 @@ menu_set_fullscreen (session_gui *gui, int full) GtkWidget * create_icon_menu (char *labeltext, void *stock_name, int is_stock) { - GtkWidget *item, *img; + GtkWidget *item; #if HAVE_GTK3 GtkWidget *box; GtkWidget *label_widget; + GtkWidget *image = NULL; const char *icon_name; #endif +#if !HAVE_GTK3 + GtkWidget *img; +#endif if (is_stock) { #if HAVE_GTK3 icon_name = gtkutil_icon_name_from_stock (stock_name); - img = NULL; if (icon_name) - img = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU); + image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU); #endif #if !HAVE_GTK3 img = gtk_image_new_from_stock (stock_name, GTK_ICON_SIZE_MENU); #endif } else + { +#if HAVE_GTK3 + image = gtk_image_new_from_pixbuf (*((GdkPixbuf **)stock_name)); +#endif +#if !HAVE_GTK3 img = gtk_image_new_from_pixbuf (*((GdkPixbuf **)stock_name)); +#endif + } #if HAVE_GTK3 item = gtk_menu_item_new (); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); label_widget = gtk_label_new_with_mnemonic (labeltext); - if (img) - gtk_box_pack_start (GTK_BOX (box), img, FALSE, FALSE, 0); + if (image) + gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (box), label_widget, FALSE, FALSE, 0); gtk_container_add (GTK_CONTAINER (item), box); #endif diff --git a/src/fe-gtk/sexy-spell-entry.c b/src/fe-gtk/sexy-spell-entry.c index 5d67fd2f..3a74ff35 100644 --- a/src/fe-gtk/sexy-spell-entry.c +++ b/src/fe-gtk/sexy-spell-entry.c @@ -642,7 +642,8 @@ sexy_spell_entry_icon_menu_item (const char *label, const char *stock_name) icon_name = gtkutil_icon_name_from_stock (stock_name); item = gtk_menu_item_new (); box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6); - image = icon_name ? gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU) : NULL; + if (icon_name) + image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU); label_widget = gtk_label_new_with_mnemonic (label); if (image) gtk_box_pack_start (GTK_BOX (box), image, FALSE, FALSE, 0);