diff --git a/ChangeLog b/ChangeLog index 1a5bb0e5f3..dd3ebc05cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-01-11 Matthias Clasen + + Bug 567024 – gtktoolbutton doesn't create right proxy menu item + image with GIcon + + * gtk/gtktoolbutton.c: Properly create a menu proxy from a GIcon. + Patch by Christian Persch + + * tests/testtoolbar.c: Add an example with a GIcon + 2009-01-09 Christian Dywan Fail in gdk_window_new if _gdk_window_new failed diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c index 60cdf4091d..65b3c1aaa9 100644 --- a/gtk/gtktoolbutton.c +++ b/gtk/gtktoolbutton.c @@ -579,6 +579,12 @@ clone_image_menu_size (GtkImage *image, GtkSettings *settings) gtk_image_get_icon_set (image, &icon_set, NULL); return gtk_image_new_from_icon_set (icon_set, GTK_ICON_SIZE_MENU); } + else if (storage_type == GTK_IMAGE_GICON) + { + GIcon *icon; + gtk_image_get_gicon (image, &icon, NULL); + return gtk_image_new_from_gicon (icon, GTK_ICON_SIZE_MENU); + } else if (storage_type == GTK_IMAGE_PIXBUF) { gint width, height; diff --git a/tests/testtoolbar.c b/tests/testtoolbar.c index 22f776199b..42e5feaea5 100644 --- a/tests/testtoolbar.c +++ b/tests/testtoolbar.c @@ -511,6 +511,7 @@ main (gint argc, gchar **argv) GtkWidget *menuitem; GtkWidget *button; GtkWidget *label; + GIcon *gicon; GSList *group; gtk_init (&argc, &argv); @@ -706,7 +707,14 @@ main (gint argc, gchar **argv) add_item_to_list (store, item, "Apple"); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1); gtk_tool_button_set_use_underline (GTK_TOOL_BUTTON (item), TRUE); - + + gicon = g_content_type_get_icon ("video/ogg"); + image = gtk_image_new_from_gicon (gicon, GTK_ICON_SIZE_LARGE_TOOLBAR); + g_object_unref (gicon); + item = gtk_tool_button_new (image, "Video"); + add_item_to_list (store, item, "Video"); + gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1); + hbox = gtk_hbox_new (FALSE, 5); gtk_container_set_border_width (GTK_CONTAINER (hbox), 5); gtk_table_attach (GTK_TABLE (table), hbox,