Index: gtk/gtktoolbar.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktoolbar.c,v
retrieving revision 1.85
diff -u -3 -p -u -w -r1.85 gtktoolbar.c
--- gtk/gtktoolbar.c	23 Jan 2003 19:48:39 -0000	1.85
+++ gtk/gtktoolbar.c	29 Jan 2003 21:49:50 -0000
@@ -1500,7 +1500,12 @@ gtk_toolbar_internal_insert_element (Gtk
       if (text)
 	{
 	  child->label = gtk_label_new (text);
+
+          if (toolbar->style == GTK_TOOLBAR_TEXT || toolbar->style == GTK_TOOLBAR_BOTH_HORIZ)
+	    gtk_box_pack_end (GTK_BOX (box), child->label, TRUE, TRUE, 0);
+          else
 	  gtk_box_pack_end (GTK_BOX (box), child->label, FALSE, FALSE, 0);
+
 	  if (toolbar->style != GTK_TOOLBAR_ICONS)
 	    gtk_widget_show (child->label);
 	}
@@ -1508,7 +1513,12 @@ gtk_toolbar_internal_insert_element (Gtk
       if (icon)
 	{
 	  child->icon = GTK_WIDGET (icon);
+
+          if (toolbar->style == GTK_TOOLBAR_ICONS)
+	    gtk_box_pack_end (GTK_BOX (box), child->icon, TRUE, TRUE, 0);
+          else
 	  gtk_box_pack_end (GTK_BOX (box), child->icon, FALSE, FALSE, 0);
+
 	  if (toolbar->style != GTK_TOOLBAR_TEXT)
 	    gtk_widget_show (child->icon);
 	}
@@ -1722,6 +1732,9 @@ gtk_real_toolbar_style_changed (GtkToolb
 	  if (child->type == GTK_TOOLBAR_CHILD_BUTTON ||
 	      child->type == GTK_TOOLBAR_CHILD_RADIOBUTTON ||
 	      child->type == GTK_TOOLBAR_CHILD_TOGGLEBUTTON)
+            {
+	      box = get_first_child (GTK_CONTAINER (child->widget));
+
 	    switch (style)
 	      {
 	      case GTK_TOOLBAR_ICONS:
@@ -1731,6 +1744,9 @@ gtk_real_toolbar_style_changed (GtkToolb
 		if (child->label && GTK_WIDGET_VISIBLE (child->label))
 		  gtk_widget_hide (child->label);
 
+                  if (child->icon)
+                    gtk_box_set_child_packing (GTK_BOX (box), child->icon,
+                                               TRUE, TRUE, 0, GTK_PACK_END);
 		break;
 
 	      case GTK_TOOLBAR_TEXT:
@@ -1740,6 +1756,9 @@ gtk_real_toolbar_style_changed (GtkToolb
 		if (child->label && !GTK_WIDGET_VISIBLE (child->label))
 		  gtk_widget_show (child->label);
 
+                  if (child->label)
+                    gtk_box_set_child_packing (GTK_BOX (box), child->label,
+                                               TRUE, TRUE, 0, GTK_PACK_END);
 		break;
 
 	      case GTK_TOOLBAR_BOTH:
@@ -1749,8 +1768,6 @@ gtk_real_toolbar_style_changed (GtkToolb
 		if (child->label && !GTK_WIDGET_VISIBLE (child->label))
 		  gtk_widget_show (child->label);
 
-		box = get_first_child (GTK_CONTAINER (child->widget));
-
 		if (GTK_IS_HBOX (box))
 		{
 		    if (child->icon)
@@ -1784,17 +1801,24 @@ gtk_real_toolbar_style_changed (GtkToolb
 		    gtk_container_add (GTK_CONTAINER (child->widget),
 				       box);
 		}
-		
+                  else
+                    {
+                      if (child->label)
+                        gtk_box_set_child_packing (GTK_BOX (box), child->label,
+                                                   FALSE, FALSE, 0, GTK_PACK_END);
+                      if (child->icon)
+                        gtk_box_set_child_packing (GTK_BOX (box), child->icon,
+                                                   FALSE, FALSE, 0, GTK_PACK_END);
+                    }
 		break;
 		
 	      case GTK_TOOLBAR_BOTH_HORIZ:
 		if (child->icon && !GTK_WIDGET_VISIBLE (child->icon))
 		  gtk_widget_show (child->icon);
+
 		if (child->label && !GTK_WIDGET_VISIBLE (child->label))
 		  gtk_widget_show (child->label);
 
-		box = get_first_child (GTK_CONTAINER (child->widget));
-		
 		if (GTK_IS_VBOX (box))
 		{
 		    if (child->icon)
@@ -1828,12 +1852,21 @@ gtk_real_toolbar_style_changed (GtkToolb
 		    gtk_container_add (GTK_CONTAINER (child->widget), box);
 		    
 		}
-		
+                  else
+                    {
+                      if (child->label)
+                        gtk_box_set_child_packing (GTK_BOX (box), child->label,
+                                                   TRUE, TRUE, 0, GTK_PACK_END);
+                      if (child->icon)
+                        gtk_box_set_child_packing (GTK_BOX (box), child->icon,
+                                                   FALSE, FALSE, 0, GTK_PACK_END);
+                    }
 		break;
 
 	      default:
 		g_assert_not_reached ();
 	      }
+            }
 	}
 
       gtk_widget_queue_resize (GTK_WIDGET (toolbar));
