diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2007-12-14 05:00:51 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2007-12-14 05:00:51 +0000 |
commit | da057b56750a588f0216d6dc69b7a898a12480f9 (patch) | |
tree | 923a823f0b7d3eafd6bdb7d3995abae99d7d585e | |
parent | 22e102081a5d2b549a26c5b77d1b1e06a39a9dc7 (diff) | |
download | gtk+-da057b56750a588f0216d6dc69b7a898a12480f9.tar.gz |
Close an api gap in tooltips
svn path=/trunk/; revision=19175
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | docs/reference/gtk/gtk-sections.txt | 1 | ||||
-rw-r--r-- | gtk/gtk.symbols | 1 | ||||
-rw-r--r-- | gtk/gtktooltip.c | 29 | ||||
-rw-r--r-- | gtk/gtktooltip.h | 3 |
5 files changed, 38 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2007-12-14 Matthias Clasen <mclasen@redhat.com> + + * gtk/gtk.symbols: + * gtk/gtktooltip.[hc]: Add gtk_tooltip_set_icon_from_icon_name(). + 2007-12-14 Kristian Rietveld <kris@imendio.com> * gtk/tests/liststore.c: diff --git a/docs/reference/gtk/gtk-sections.txt b/docs/reference/gtk/gtk-sections.txt index 92fda0f965..11ac490a50 100644 --- a/docs/reference/gtk/gtk-sections.txt +++ b/docs/reference/gtk/gtk-sections.txt @@ -4181,6 +4181,7 @@ gtk_tooltip_set_markup gtk_tooltip_set_text gtk_tooltip_set_icon gtk_tooltip_set_icon_from_stock +gtk_tooltip_set_icon_from_icon_name gtk_tooltip_set_custom gtk_tooltip_trigger_tooltip_query gtk_tooltip_set_tip_area diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols index 0910ff9f13..c928acfdb0 100644 --- a/gtk/gtk.symbols +++ b/gtk/gtk.symbols @@ -4103,6 +4103,7 @@ gtk_tooltip_get_type G_GNUC_CONST gtk_tooltip_set_custom gtk_tooltip_set_icon gtk_tooltip_set_icon_from_stock +gtk_tooltip_set_icon_from_icon_name gtk_tooltip_set_markup gtk_tooltip_set_text gtk_tooltip_set_tip_area diff --git a/gtk/gtktooltip.c b/gtk/gtktooltip.c index 56a944d00d..762840374b 100644 --- a/gtk/gtktooltip.c +++ b/gtk/gtktooltip.c @@ -274,7 +274,7 @@ gtk_tooltip_set_icon (GtkTooltip *tooltip, /** * gtk_tooltip_set_icon_from_stock: * @tooltip: a #GtkTooltip - * @stock_id: a stock icon name, or %NULL + * @stock_id: a stock id, or %NULL * @size: a stock icon size * * Sets the icon of the tooltip (which is in front of the text) to be @@ -299,6 +299,33 @@ gtk_tooltip_set_icon_from_stock (GtkTooltip *tooltip, } /** + * gtk_tooltip_set_icon_from_icon_name: + * @tooltip: a #GtkTooltip + * @icon_name: an icon name, or %NULL + * @size: a stock icon size + * + * Sets the icon of the tooltip (which is in front of the text) to be + * the icon indicated by @icon_name with the size indicated + * by @size. If @icon_name is %NULL, the image will be hidden. + * + * Since: 2.16 + */ +void +gtk_tooltip_set_icon_from_icon_name(GtkTooltip *tooltip, + const gchar *icon_name, + GtkIconSize size) +{ + g_return_if_fail (GTK_IS_TOOLTIP (tooltip)); + + gtk_image_set_from_icon_name (GTK_IMAGE (tooltip->image), icon_name, size); + + if (icon_name) + gtk_widget_show (tooltip->image); + else + gtk_widget_hide (tooltip->image); +} + +/** * gtk_tooltip_set_custom: * @tooltip: a #GtkTooltip * @custom_widget: a #GtkWidget diff --git a/gtk/gtktooltip.h b/gtk/gtktooltip.h index bc498af478..5c29a9a5a5 100644 --- a/gtk/gtktooltip.h +++ b/gtk/gtktooltip.h @@ -42,6 +42,9 @@ void gtk_tooltip_set_icon (GtkTooltip *tooltip, void gtk_tooltip_set_icon_from_stock (GtkTooltip *tooltip, const gchar *stock_id, GtkIconSize size); +void gtk_tooltip_set_icon_from_icon_name (GtkTooltip *tooltip, + const gchar *icon_name, + GtkIconSize size); void gtk_tooltip_set_custom (GtkTooltip *tooltip, GtkWidget *custom_widget); |