]> Pileus Git - ~andy/gtk/commitdiff
Correctly clone the toolbutton's icon-name image widget
authorChristian Persch <chpe@gnome.org>
Tue, 26 Jan 2010 14:41:00 +0000 (15:41 +0100)
committerTristan Van Berkom <tristan.van.berkom@gmail.com>
Sun, 4 Apr 2010 00:56:08 +0000 (20:56 -0400)
Bug #608162.

gtk/gtktoolbutton.c
tests/testtoolbar.c

index 5fdcc548f0e15a2c5e6875b2f7c940f2e202bb0d..74fe78a9b193243e2329a39c21774920029daa55 100644 (file)
@@ -652,6 +652,12 @@ clone_image_menu_size (GtkImage *image, GtkSettings *settings)
       gtk_image_get_stock (image, &stock_id, NULL);
       return gtk_image_new_from_stock (stock_id, GTK_ICON_SIZE_MENU);
     }
+  else if (storage_type == GTK_IMAGE_ICON_NAME)
+    {
+      const gchar *icon_name;
+      gtk_image_get_icon_name (image, &icon_name, NULL);
+      return gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
+    }
   else if (storage_type == GTK_IMAGE_ICON_SET)
     {
       GtkIconSet *icon_set;
index 42e5feaea58c39b29b175836bb78403867500f96..af7cbee7821a2572b68d1439c9ddd14dc13a620c 100644 (file)
@@ -715,6 +715,11 @@ main (gint argc, gchar **argv)
   add_item_to_list (store, item, "Video");
   gtk_toolbar_insert (GTK_TOOLBAR (toolbar), item, -1);
 
+  image = gtk_image_new_from_icon_name ("utility-terminal", GTK_ICON_SIZE_LARGE_TOOLBAR);
+  item = gtk_tool_button_new (image, "Terminal");
+  add_item_to_list (store, item, "Terminal");
+  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,