diff options
author | Peter Harvey <peter.a.harvey@gmail.com> | 2006-02-02 22:01:38 +0800 |
---|---|---|
committer | Peter Anthony Harvey <paharvey@src.gnome.org> | 2006-02-02 22:01:38 +0800 |
commit | 42396674cbe534a6e5d0ca0bf232872179a306a2 (patch) | |
tree | 38a36efe8b432568e79c3eda6f2704e00818b0cd /src/bookmarks/ephy-bookmark-action.c | |
parent | 4d8b2c6114da0d8b629215a2ca690411d1d71949 (diff) | |
download | gsoc2013-epiphany-42396674cbe534a6e5d0ca0bf232872179a306a2.tar gsoc2013-epiphany-42396674cbe534a6e5d0ca0bf232872179a306a2.tar.gz gsoc2013-epiphany-42396674cbe534a6e5d0ca0bf232872179a306a2.tar.bz2 gsoc2013-epiphany-42396674cbe534a6e5d0ca0bf232872179a306a2.tar.lz gsoc2013-epiphany-42396674cbe534a6e5d0ca0bf232872179a306a2.tar.xz gsoc2013-epiphany-42396674cbe534a6e5d0ca0bf232872179a306a2.tar.zst gsoc2013-epiphany-42396674cbe534a6e5d0ca0bf232872179a306a2.zip |
src/bookmarks/ephy-bookmark-action.c
2006-02-02 Peter Harvey <peter.a.harvey@gmail.com>
* src/bookmarks/ephy-bookmark-action.c
Allow bookmarks on the toolbar to be dragged.
* src/bookmarks/ephy-topic-action.c
Remove redundant function call.
Diffstat (limited to 'src/bookmarks/ephy-bookmark-action.c')
-rw-r--r-- | src/bookmarks/ephy-bookmark-action.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c index 55ef0ac71..11fd985e8 100644 --- a/src/bookmarks/ephy-bookmark-action.c +++ b/src/bookmarks/ephy-bookmark-action.c @@ -31,6 +31,7 @@ #include "ephy-shell.h" #include "ephy-gui.h" #include "ephy-debug.h" +#include "ephy-dnd.h" #include <glib/gi18n.h> #include <gtk/gtkwidget.h> @@ -49,6 +50,10 @@ #include <string.h> +static const GtkTargetEntry drag_types[] = { + {EPHY_DND_URL_TYPE, 0, 0}, +}; + /* FIXME tweak this, or make it configurable? (bug 148093) */ #define ENTRY_WIDTH_CHARS 12 #define TOOLITEM_WIDTH_CHARS 20 @@ -414,6 +419,21 @@ button_release_cb (GtkWidget *widget, return FALSE; } +static void +drag_data_get_cb (GtkWidget *widget, + GdkDragContext *context, + GtkSelectionData *selection_data, + guint info, + guint32 time, + GtkAction *action) +{ + EphyNode *node = ephy_bookmark_action_get_bookmark (EPHY_BOOKMARK_ACTION (action)); + const char *location = ephy_node_get_property_string (node, EPHY_NODE_BMK_PROP_LOCATION); + + g_return_if_fail (location != NULL); + + gtk_selection_data_set (selection_data, selection_data->target, 8, (unsigned char *)location, strlen (location)); +} static void connect_proxy (GtkAction *action, GtkWidget *proxy) @@ -448,6 +468,11 @@ connect_proxy (GtkAction *action, GtkWidget *proxy) entry = GTK_WIDGET (g_object_get_data (G_OBJECT (proxy), "entry")); g_signal_connect (entry, "activate", G_CALLBACK (activate_cb), action); g_signal_connect (entry, "key-press-event", G_CALLBACK (entry_key_press_cb), action); + + g_signal_connect (button, "drag-data-get", + G_CALLBACK (drag_data_get_cb), action); + gtk_drag_source_set (button, GDK_BUTTON1_MASK, drag_types, + G_N_ELEMENTS (drag_types), GDK_ACTION_COPY); } else if (GTK_IS_MENU_ITEM (proxy)) { |