diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | ChangeLog.pre-2-10 | 7 | ||||
-rw-r--r-- | docs/reference/gtk/tmpl/gtkenums.sgml | 4 | ||||
-rw-r--r-- | gtk/gtktoolbutton.c | 16 |
4 files changed, 33 insertions, 1 deletions
@@ -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/gtktextview.c (gtk_text_view_preedit_changed_handler): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0ef51bab1..f1aab5127 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -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/gtktextview.c (gtk_text_view_preedit_changed_handler): diff --git a/docs/reference/gtk/tmpl/gtkenums.sgml b/docs/reference/gtk/tmpl/gtkenums.sgml index 334fa5812..5d95c5eee 100644 --- a/docs/reference/gtk/tmpl/gtkenums.sgml +++ b/docs/reference/gtk/tmpl/gtkenums.sgml @@ -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. diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c index 4663a4a13..da1fac43e 100644 --- a/gtk/gtktoolbutton.c +++ b/gtk/gtktoolbutton.c @@ -319,6 +319,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) { |