diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | src/ephy-favicon-action.c | 44 | ||||
-rwxr-xr-x | src/toolbar.c | 1 |
3 files changed, 43 insertions, 11 deletions
@@ -1,5 +1,14 @@ 2004-10-22 Christian Persch <chpe@cvs.gnome.org> + * src/ephy-favicon-action.c: (create_tool_item), (set_tooltip_cb), + (connect_proxy), (ephy_favicon_action_set_property), + (ephy_favicon_action_get_property): + * src/toolbar.c: (toolbar_setup_actions): + + Add tooltip on the drag handle. Fixes bug #155827. + +2004-10-22 Christian Persch <chpe@cvs.gnome.org> + * src/ephy-navigation-action.c: (set_tooltip_cb), (connect_proxy), (ephy_navigation_action_finalize), (ephy_navigation_action_set_property), diff --git a/src/ephy-favicon-action.c b/src/ephy-favicon-action.c index 57a167138..db66b1c1e 100644 --- a/src/ephy-favicon-action.c +++ b/src/ephy-favicon-action.c @@ -34,6 +34,7 @@ #include <gtk/gtkimage.h> #include <gtk/gtkstock.h> #include <gtk/gtkeventbox.h> +#include <gtk/gtktooltips.h> static GtkTargetEntry url_drag_types [] = { @@ -145,6 +146,7 @@ create_tool_item (GtkAction *action) gtk_widget_show (image); gtk_widget_show (ebox); + g_object_set_data (G_OBJECT (item), "ebox", ebox); g_object_set_data (G_OBJECT (item), "image", image); gtk_drag_source_set (ebox, @@ -190,15 +192,39 @@ ephy_favicon_action_sync_icon (GtkAction *action, GParamSpec *pspec, } } +static gboolean +set_tooltip_cb (GtkToolItem *item, + GtkTooltips *tooltips, + const char *tip, + const char *tip_private, + EphyFaviconAction *action) +{ + GtkWidget *ebox; + + ebox = g_object_get_data (G_OBJECT (item), "ebox"); + g_return_val_if_fail (ebox != NULL, FALSE); + + gtk_tooltips_set_tip (tooltips, ebox, tip, tip_private); + + return TRUE; +} + static void connect_proxy (GtkAction *action, GtkWidget *proxy) { - ephy_favicon_action_sync_icon (action, NULL, proxy); - g_signal_connect_object (action, "notify::icon", - G_CALLBACK (ephy_favicon_action_sync_icon), - proxy, 0); + if (GTK_IS_TOOL_ITEM (proxy)) + { + ephy_favicon_action_sync_icon (action, NULL, proxy); + g_signal_connect_object (action, "notify::icon", + G_CALLBACK (ephy_favicon_action_sync_icon), + proxy, 0); + + g_signal_connect (proxy, "set-tooltip", + G_CALLBACK (set_tooltip_cb), action); + + } - (* GTK_ACTION_CLASS (parent_class)->connect_proxy) (action, proxy); + GTK_ACTION_CLASS (parent_class)->connect_proxy (action, proxy); } static void @@ -207,9 +233,7 @@ ephy_favicon_action_set_property (GObject *object, const GValue *value, GParamSpec *pspec) { - EphyFaviconAction *fav; - - fav = EPHY_FAVICON_ACTION (object); + EphyFaviconAction *fav = EPHY_FAVICON_ACTION (object); switch (prop_id) { @@ -229,9 +253,7 @@ ephy_favicon_action_get_property (GObject *object, GValue *value, GParamSpec *pspec) { - EphyFaviconAction *fav; - - fav = EPHY_FAVICON_ACTION (object); + EphyFaviconAction *fav = EPHY_FAVICON_ACTION (object); switch (prop_id) { diff --git a/src/toolbar.c b/src/toolbar.c index e4242b971..60e003a11 100755 --- a/src/toolbar.c +++ b/src/toolbar.c @@ -366,6 +366,7 @@ toolbar_setup_actions (Toolbar *t) action = g_object_new (EPHY_TYPE_FAVICON_ACTION, "name", "Favicon", "label", _("Favicon"), + "tooltip", _("Drag and drop this icon to create a link to this page"), "window", t->priv->window, "visible-overflown", FALSE, NULL); |