aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-notebook.c
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-05-11 20:27:27 +0800
committerChristian Persch <chpe@src.gnome.org>2006-05-11 20:27:27 +0800
commit9939b3eb08798c81c01720c3207d41662064f046 (patch)
tree617aa76a011c133960812dcf4ff201fd929512b9 /src/ephy-notebook.c
parentb15ab14ae41b52fa6b14c283b937fb346b0cf9b6 (diff)
downloadgsoc2013-epiphany-9939b3eb08798c81c01720c3207d41662064f046.tar
gsoc2013-epiphany-9939b3eb08798c81c01720c3207d41662064f046.tar.gz
gsoc2013-epiphany-9939b3eb08798c81c01720c3207d41662064f046.tar.bz2
gsoc2013-epiphany-9939b3eb08798c81c01720c3207d41662064f046.tar.lz
gsoc2013-epiphany-9939b3eb08798c81c01720c3207d41662064f046.tar.xz
gsoc2013-epiphany-9939b3eb08798c81c01720c3207d41662064f046.tar.zst
gsoc2013-epiphany-9939b3eb08798c81c01720c3207d41662064f046.zip
Allow text drags to notebook tab labels. Bug #339339, patch by Michael
2006-05-11 Christian Persch <chpe@cvs.gnome.org> * src/ephy-notebook.c: (notebook_drag_data_received_cb), (ephy_notebook_init), (build_tab_label): Allow text drags to notebook tab labels. Bug #339339, patch by Michael Hofmann.
Diffstat (limited to 'src/ephy-notebook.c')
-rw-r--r--src/ephy-notebook.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/ephy-notebook.c b/src/ephy-notebook.c
index 001ac21f1..171be42a1 100644
--- a/src/ephy-notebook.c
+++ b/src/ephy-notebook.c
@@ -441,7 +441,17 @@ notebook_drag_data_received_cb (GtkWidget* widget, GdkDragContext *context,
}
else
{
- g_return_if_reached ();
+ char *text;
+
+ text = (char *) gtk_selection_data_get_text (selection_data);
+ if (text != NULL) {
+ ephy_link_open (EPHY_LINK (notebook), text, tab,
+ tab ? 0 : EPHY_LINK_NEW_TAB);
+ g_free (text);
+ }
+ else {
+ g_return_if_reached ();
+ }
}
}
@@ -504,6 +514,7 @@ ephy_notebook_init (EphyNotebook *notebook)
GTK_DEST_DEFAULT_DROP,
url_drag_types, G_N_ELEMENTS (url_drag_types),
GDK_ACTION_MOVE | GDK_ACTION_COPY);
+ gtk_drag_dest_add_text_targets (GTK_WIDGET(notebook));
notebook->priv->tabs_vis_notifier_id = eel_gconf_notification_add
(CONF_ALWAYS_SHOW_TABS_BAR,
@@ -689,6 +700,7 @@ build_tab_label (EphyNotebook *nb, EphyTab *tab)
gtk_drag_dest_set (hbox, GTK_DEST_DEFAULT_ALL,
url_drag_types, G_N_ELEMENTS (url_drag_types),
GDK_ACTION_MOVE | GDK_ACTION_COPY);
+ gtk_drag_dest_add_text_targets (label);
gtk_widget_show (hbox);
gtk_widget_show (label_ebox);