summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoss Burton <rburton@src.gnome.org>2005-12-07 17:07:42 +0000
committerRoss Burton <rburton@src.gnome.org>2005-12-07 17:07:42 +0000
commitf1e45e5fc2125142c74f8bffc304d84b9f2a538a (patch)
treec4a0c40f63774ac8e2310d81fdf922bd56238343
parent05c3415a5be070050ecb2d47fa57a4b152b1be6e (diff)
downloadgdk-pixbuf-f1e45e5fc2125142c74f8bffc304d84b9f2a538a.tar.gz
If the toolbar mode is ICONS and there is no icon set then show the label, and vice versa (#322019)
-rw-r--r--ChangeLog7
-rw-r--r--ChangeLog.pre-2-107
-rw-r--r--docs/reference/gtk/tmpl/gtkenums.sgml4
-rw-r--r--gtk/gtktoolbutton.c16
4 files changed, 33 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 0ef51bab1..f1aab5127 100644
--- 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/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)
{