aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-10-22 23:53:45 +0800
committerChristian Persch <chpe@src.gnome.org>2004-10-22 23:53:45 +0800
commit5e0872332cd0be1b5035df05805cc76ebb6ba820 (patch)
tree062a6ec909d057a0a17492fa839ce28f46af9ebc
parentc32a9d9770aa342802bb8f8bdf5e54663b40437f (diff)
downloadgsoc2013-epiphany-5e0872332cd0be1b5035df05805cc76ebb6ba820.tar
gsoc2013-epiphany-5e0872332cd0be1b5035df05805cc76ebb6ba820.tar.gz
gsoc2013-epiphany-5e0872332cd0be1b5035df05805cc76ebb6ba820.tar.bz2
gsoc2013-epiphany-5e0872332cd0be1b5035df05805cc76ebb6ba820.tar.lz
gsoc2013-epiphany-5e0872332cd0be1b5035df05805cc76ebb6ba820.tar.xz
gsoc2013-epiphany-5e0872332cd0be1b5035df05805cc76ebb6ba820.tar.zst
gsoc2013-epiphany-5e0872332cd0be1b5035df05805cc76ebb6ba820.zip
Add tooltip on the drag handle. Fixes bug #155827.
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.
-rw-r--r--ChangeLog9
-rw-r--r--src/ephy-favicon-action.c44
-rwxr-xr-xsrc/toolbar.c1
3 files changed, 43 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index cbaf3043a..a84742fb4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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);