diff options
author | Přemysl Eric Janouch <p@janouch.name> | 2022-01-07 07:39:20 +0100 |
---|---|---|
committer | Přemysl Eric Janouch <p@janouch.name> | 2022-01-07 07:41:05 +0100 |
commit | 59af3b7e7b9f73de9ff80ae91cd42085b26d840d (patch) | |
tree | 2316a8c6ac4fcc3677f5d4b656dbeb1a7f6a8246 | |
parent | fc559c3d0152c8adcb6cc01166951456b588069a (diff) | |
download | fiv-59af3b7e7b9f73de9ff80ae91cd42085b26d840d.tar.gz fiv-59af3b7e7b9f73de9ff80ae91cd42085b26d840d.tar.xz fiv-59af3b7e7b9f73de9ff80ae91cd42085b26d840d.zip |
Show sidebar DnD targets when dragging breadcrumbs
-rw-r--r-- | fiv-sidebar.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/fiv-sidebar.c b/fiv-sidebar.c index ec5898c..907793a 100644 --- a/fiv-sidebar.c +++ b/fiv-sidebar.c @@ -133,6 +133,20 @@ on_breadcrumb_drag_data_get(G_GNUC_UNUSED GtkWidget *widget, g_free(*uris); } +static void +on_breadcrumb_drag_begin(G_GNUC_UNUSED GtkWidget *widget, + GdkDragContext *context, gpointer user_data) +{ + gtk_places_sidebar_set_drop_targets_visible(user_data, TRUE, context); +} + +static void +on_breadcrumb_drag_end(G_GNUC_UNUSED GtkWidget *widget, + GdkDragContext *context, gpointer user_data) +{ + gtk_places_sidebar_set_drop_targets_visible(user_data, FALSE, context); +} + static GtkWidget * create_row(FivSidebar *self, GFile *file, const char *icon_name) { @@ -191,6 +205,10 @@ create_row(FivSidebar *self, GFile *file, const char *icon_name) G_CALLBACK(on_breadcrumb_release), row); g_signal_connect(revealer, "drag-data-get", G_CALLBACK(on_breadcrumb_drag_data_get), row); + g_signal_connect(revealer, "drag-begin", + G_CALLBACK(on_breadcrumb_drag_begin), self->places); + g_signal_connect(revealer, "drag-end", + G_CALLBACK(on_breadcrumb_drag_end), self->places); gtk_container_add(GTK_CONTAINER(row), revealer); gtk_widget_show_all(row); |