diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2008-02-11 09:54:09 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@src.gnome.org> | 2008-02-11 09:54:09 +0000 |
commit | 48c87e3e17c4ab6df5db22af23a5bd9ec0bf89c8 (patch) | |
tree | 6f4ea9ceccf53b3d8c1af1e2c482cbced7101a6a /gtk/gtklinkbutton.c | |
parent | 97e0d1120f3ac52fe5a271ffb75b2eb81632a3f6 (diff) | |
download | gtk+-48c87e3e17c4ab6df5db22af23a5bd9ec0bf89c8.tar.gz |
Set no-show-all flag on the placeholder menu item.
2008-02-11 Emmanuele Bassi <ebassi@gnome.org>
* gtk/gtkrecentchoosermenu.c:
(gtk_recent_chooser_menu_constructor): Set no-show-all flag
on the placeholder menu item.
* tests/testrecentchoosermenu.c:
(create_recent_chooser_menu): Use gtk_widget_show_all() to test
whether the placeholder menu item gets shown.
svn path=/trunk/; revision=19509
Diffstat (limited to 'gtk/gtklinkbutton.c')
-rw-r--r-- | gtk/gtklinkbutton.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/gtk/gtklinkbutton.c b/gtk/gtklinkbutton.c index 927b9b6f1f..395684ebd1 100644 --- a/gtk/gtklinkbutton.c +++ b/gtk/gtklinkbutton.c @@ -538,8 +538,8 @@ gtk_link_button_new (const gchar *uri) } retval = g_object_new (GTK_TYPE_LINK_BUTTON, - "uri", uri, "label", utf8_uri, + "uri", uri, NULL); g_free (utf8_uri); @@ -590,17 +590,24 @@ void gtk_link_button_set_uri (GtkLinkButton *link_button, const gchar *uri) { + GtkLinkButtonPrivate *priv; + const gchar *label; gchar *tmp; g_return_if_fail (GTK_IS_LINK_BUTTON (link_button)); g_return_if_fail (uri != NULL); - - tmp = link_button->priv->uri; - link_button->priv->uri = g_strdup (uri); - g_free (tmp); - link_button->priv->visited = FALSE; - + priv = link_button->priv; + + g_free (priv->uri); + priv->uri = g_strdup (uri); + + label = gtk_button_get_label (GTK_BUTTON (link_button)); + if (label && *label != '\0' && strcmp (label, uri) != 0) + gtk_widget_set_tooltip_text (GTK_WIDGET (link_button), uri); + + priv->visited = FALSE; + g_object_notify (G_OBJECT (link_button), "uri"); } |