aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmark-action.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-05-20 02:42:22 +0800
committerChristian Persch <chpe@src.gnome.org>2004-05-20 02:42:22 +0800
commitc26be9eaf445f04efd11ff3cb3daed38626b1b12 (patch)
tree92ae7f09f9ec0b7981675f676faa6cca8f09629e /src/bookmarks/ephy-bookmark-action.c
parentf7d64a2da37e5d187d259fa6bb15e2a1e8e959d7 (diff)
downloadgsoc2013-epiphany-c26be9eaf445f04efd11ff3cb3daed38626b1b12.tar.gz
gsoc2013-epiphany-c26be9eaf445f04efd11ff3cb3daed38626b1b12.tar.zst
gsoc2013-epiphany-c26be9eaf445f04efd11ff3cb3daed38626b1b12.zip
Open bookmark in new tab on middle-click. Fixes bug #106250.
2004-05-19 Christian Persch <chpe@cvs.gnome.org> * src/bookmarks/ephy-bookmark-action.c: (activate_cb), (button_press_cb), (button_release_cb), (connect_proxy), (ephy_bookmark_action_class_init): * src/toolbar.c: (go_location_cb): Open bookmark in new tab on middle-click. Fixes bug #106250.
Diffstat (limited to 'src/bookmarks/ephy-bookmark-action.c')
-rw-r--r--src/bookmarks/ephy-bookmark-action.c40
1 files changed, 35 insertions, 5 deletions
diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c
index 6bdc0d72e..479790bc1 100644
--- a/src/bookmarks/ephy-bookmark-action.c
+++ b/src/bookmarks/ephy-bookmark-action.c
@@ -69,7 +69,7 @@ enum
static GObjectClass *parent_class = NULL;
-static guint ephy_bookmark_action_signals[LAST_SIGNAL] = { 0 };
+static guint signals[LAST_SIGNAL] = { 0 };
GType
ephy_bookmark_action_get_type (void)
@@ -319,14 +319,40 @@ activate_cb (GtkWidget *widget, GtkAction *action)
}
}
- g_signal_emit (action,
- ephy_bookmark_action_signals[GO_LOCATION],
- 0, location);
+ g_signal_emit (action, signals[GO_LOCATION], 0, location);
g_free (location);
g_free (text);
}
+static gboolean
+button_press_cb (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer dummy)
+{
+ if (event->type == GDK_BUTTON_PRESS && event->button == 2)
+ {
+ gtk_button_pressed (GTK_BUTTON (widget));
+ }
+
+ return FALSE;
+}
+
+static gboolean
+button_release_cb (GtkWidget *widget,
+ GdkEventButton *event,
+ gpointer dummy)
+{
+ if (event->type == GDK_BUTTON_RELEASE && event->button == 2)
+ {
+ gtk_button_released (GTK_BUTTON (widget));
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
static void
connect_proxy (GtkAction *action, GtkWidget *proxy)
{
@@ -352,6 +378,10 @@ connect_proxy (GtkAction *action, GtkWidget *proxy)
{
button = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "button"));
g_signal_connect (button, "clicked", G_CALLBACK (activate_cb), action);
+ g_signal_connect (button, "button-press-event",
+ G_CALLBACK (button_press_cb), NULL);
+ g_signal_connect (button, "button-release-event",
+ G_CALLBACK (button_release_cb), NULL);
entry = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "entry"));
g_signal_connect (entry, "activate", G_CALLBACK (activate_cb), action);
@@ -450,7 +480,7 @@ ephy_bookmark_action_class_init (EphyBookmarkActionClass *class)
object_class->set_property = ephy_bookmark_action_set_property;
object_class->get_property = ephy_bookmark_action_get_property;
- ephy_bookmark_action_signals[GO_LOCATION] =
+ signals[GO_LOCATION] =
g_signal_new ("go_location",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST,