Index: gtk/gtktoolbar.c
===================================================================
RCS file: /cvs/gnome/gtk+/gtk/gtktoolbar.c,v
retrieving revision 1.85
diff -u -3 -p -r1.85 gtktoolbar.c
--- gtk/gtktoolbar.c	23 Jan 2003 19:48:39 -0000	1.85
+++ gtk/gtktoolbar.c	28 Jan 2003 22:01:42 -0000
@@ -1500,7 +1500,12 @@ gtk_toolbar_internal_insert_element (Gtk
       if (text)
 	{
 	  child->label = gtk_label_new (text);
-	  gtk_box_pack_end (GTK_BOX (box), child->label, FALSE, FALSE, 0);
+
+          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);
-	  gtk_box_pack_end (GTK_BOX (box), child->icon, FALSE, FALSE, 0);
+
+          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,118 +1732,141 @@ 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)
-	    switch (style)
-	      {
-	      case GTK_TOOLBAR_ICONS:
-		if (child->icon && !GTK_WIDGET_VISIBLE (child->icon))
-		  gtk_widget_show (child->icon);
-
-		if (child->label && GTK_WIDGET_VISIBLE (child->label))
-		  gtk_widget_hide (child->label);
-
-		break;
-
-	      case GTK_TOOLBAR_TEXT:
-		if (child->icon && GTK_WIDGET_VISIBLE (child->icon))
-		  gtk_widget_hide (child->icon);
-		
-		if (child->label && !GTK_WIDGET_VISIBLE (child->label))
-		  gtk_widget_show (child->label);
-
-		break;
-
-	      case GTK_TOOLBAR_BOTH:
-		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_HBOX (box))
-		{
-		    if (child->icon)
-		    {
-			g_object_ref (child->icon);
-			gtk_container_remove (GTK_CONTAINER (box),
-					      child->icon);
-		    }
-		    if (child->label)
-		    {
-			g_object_ref (child->label);
-			gtk_container_remove (GTK_CONTAINER (box),
-					      child->label);
-		    }
-		    gtk_container_remove (GTK_CONTAINER (child->widget),
-					  box);
-		    
-		    box = gtk_vbox_new (FALSE, 0);
-		    gtk_widget_show (box);
-		    
-		    if (child->label)
-		    {
-			gtk_box_pack_end (GTK_BOX (box), child->label, FALSE, FALSE, 0);
-			g_object_unref (child->label);
-		    }
-		    if (child->icon)
-		    {
-			gtk_box_pack_end (GTK_BOX (box), child->icon, FALSE, FALSE, 0);
-			g_object_unref (child->icon);
-		    }
-		    gtk_container_add (GTK_CONTAINER (child->widget),
-				       box);
-		}
-		
-		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)
-		    {
-			g_object_ref (child->icon);
-			gtk_container_remove (GTK_CONTAINER (box),
-					      child->icon);
-		    }
-		    if (child->label)
-		    {
-			g_object_ref (child->label);
-			gtk_container_remove (GTK_CONTAINER (box),
-					      child->label);
-		    }
-		    gtk_container_remove (GTK_CONTAINER (child->widget),
-					  box);
-
-		    box = gtk_hbox_new (FALSE, 0);
-		    gtk_widget_show (box);
-		    
-		    if (child->label)
-		    {
-			gtk_box_pack_end (GTK_BOX (box), child->label, TRUE, TRUE, 0);
-			g_object_unref (child->label);
-		    }
-		    if (child->icon)
-		    {
-			gtk_box_pack_end (GTK_BOX (box), child->icon, FALSE, FALSE, 0);
-			g_object_unref (child->icon);
-		    }
-		    gtk_container_add (GTK_CONTAINER (child->widget), box);
-		    
-		}
-		
-		break;
-
-	      default:
-		g_assert_not_reached ();
-	      }
+            {
+	      box = get_first_child (GTK_CONTAINER (child->widget));
+
+              switch (style)
+                {
+                case GTK_TOOLBAR_ICONS:
+                  if (child->icon && !GTK_WIDGET_VISIBLE (child->icon))
+                    gtk_widget_show (child->icon);
+
+                  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:
+                  if (child->icon && GTK_WIDGET_VISIBLE (child->icon))
+                    gtk_widget_hide (child->icon);
+                  
+                  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:
+                  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);
+
+                  if (GTK_IS_HBOX (box))
+                    {
+                      if (child->icon)
+                        {
+                          g_object_ref (child->icon);
+                          gtk_container_remove (GTK_CONTAINER (box),
+                                                child->icon);
+                        }
+                      if (child->label)
+                        {
+                          g_object_ref (child->label);
+                          gtk_container_remove (GTK_CONTAINER (box),
+                                                child->label);
+                        }
+                      gtk_container_remove (GTK_CONTAINER (child->widget),
+                                            box);
+                      
+                      box = gtk_vbox_new (FALSE, 0);
+                      gtk_widget_show (box);
+                      
+                      if (child->label)
+                        {
+                          gtk_box_pack_end (GTK_BOX (box), child->label, FALSE, FALSE, 0);
+                          g_object_unref (child->label);
+                        }
+                      if (child->icon)
+                        {
+                          gtk_box_pack_end (GTK_BOX (box), child->icon, FALSE, FALSE, 0);
+                          g_object_unref (child->icon);
+                        }
+                      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);
+
+                  if (GTK_IS_VBOX (box))
+                    {
+                      if (child->icon)
+                        {
+                          g_object_ref (child->icon);
+                          gtk_container_remove (GTK_CONTAINER (box),
+                                                child->icon);
+                        }
+                      if (child->label)
+                        {
+                          g_object_ref (child->label);
+                          gtk_container_remove (GTK_CONTAINER (box),
+                                                child->label);
+                        }
+                      gtk_container_remove (GTK_CONTAINER (child->widget),
+                                            box);
+
+                      box = gtk_hbox_new (FALSE, 0);
+                      gtk_widget_show (box);
+                      
+                      if (child->label)
+                        {
+                          gtk_box_pack_end (GTK_BOX (box), child->label, TRUE, TRUE, 0);
+                          g_object_unref (child->label);
+                        }
+                      if (child->icon)
+                        {
+                          gtk_box_pack_end (GTK_BOX (box), child->icon, FALSE, FALSE, 0);
+                          g_object_unref (child->icon);
+                        }
+                      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));
