]> Pileus Git - ~andy/gtk/commitdiff
If the toolbar mode is ICONS and there is no icon set then show the label, and vice...
authorRoss Burton <rburton@src.gnome.org>
Wed, 7 Dec 2005 17:14:07 +0000 (17:14 +0000)
committerRoss Burton <rburton@src.gnome.org>
Wed, 7 Dec 2005 17:14:07 +0000 (17:14 +0000)
ChangeLog
ChangeLog.pre-2-10
docs/reference/gtk/tmpl/gtkenums.sgml
gtk/gtktoolbutton.c

index 587c4ea8670f2b06a36369fb0672a59581d3f44a..218b8bd00b58eba5f53ad2eebcf761dc3c003ad2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-12-07  Ross Burton  <ross@burtonini.com>
+
+       * docs/reference/gtk/tmpl/gtkenums.sgml:
+       * gtk/gtktoolbutton.c:
+       If the toolbar mode is ICONS and there is no icon set then show
+       the label, and vice versa (#322019)
+
 2005-12-07  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_key_press): Use the correct
index 587c4ea8670f2b06a36369fb0672a59581d3f44a..218b8bd00b58eba5f53ad2eebcf761dc3c003ad2 100644 (file)
@@ -1,3 +1,10 @@
+2005-12-07  Ross Burton  <ross@burtonini.com>
+
+       * docs/reference/gtk/tmpl/gtkenums.sgml:
+       * gtk/gtktoolbutton.c:
+       If the toolbar mode is ICONS and there is no icon set then show
+       the label, and vice versa (#322019)
+
 2005-12-07  Matthias Clasen  <mclasen@redhat.com>
 
        * gtk/gtktreeview.c (gtk_tree_view_key_press): Use the correct
index 334fa5812d7349ab0e81417a8e58e829a546fc15..5d95c5eee3c74f5d0a229154d40777b793b29923 100644 (file)
@@ -410,7 +410,9 @@ Indicates the direction a sub-menu will appear.
 <para>
 Used to customize the appearance of a #GtkToolbar. Note that 
 setting the toolbar style overrides the user's preferences
-for the default toolbar style.
+for the default toolbar style.  Note that if the button has only
+a label set and GTK_TOOLBAR_ICONS is used, the label will be
+visible, and vice versa.
 </para>
 
 @GTK_TOOLBAR_ICONS: Buttons display only icons in the toolbar.
index c7c075110b849a2317df48c0ecb2cf777c249195..7c06409f357aa9aef6080a581b275d0b0e7bc731 100644 (file)
@@ -317,6 +317,22 @@ gtk_tool_button_construct_contents (GtkToolItem *tool_item)
     {
       need_label = TRUE;
     }
+  
+  if (style == GTK_TOOLBAR_ICONS && button->priv->icon_widget == NULL &&
+      button->priv->stock_id == NULL && button->priv->icon_name == NULL)
+    {
+      need_label = TRUE;
+      need_icon = FALSE;
+      style = GTK_TOOLBAR_TEXT;
+    }
+
+  if (style == GTK_TOOLBAR_TEXT && button->priv->label_widget == NULL &&
+      button->priv->stock_id == NULL && button->priv->label_text == NULL)
+    {
+      need_label = FALSE;
+      need_icon = TRUE;
+      style = GTK_TOOLBAR_ICONS;
+    }
 
   if (need_label)
     {