diff options
author | Carlos Soriano <csoriano@gnome.org> | 2015-04-11 17:36:41 +0200 |
---|---|---|
committer | Carlos Soriano <csoriano@gnome.org> | 2015-06-16 16:19:37 +0200 |
commit | 43a4843b9caf745823210fdbca95123cd560e48b (patch) | |
tree | 839f42514e1be5fe52d913e8c2f48251eac54e19 /gtk/gtkfilechooserwidget.c | |
parent | 4499174e32f73aeb24494c3e8d309c7486170cd7 (diff) | |
download | gtk+-43a4843b9caf745823210fdbca95123cd560e48b.tar.gz |
gtkfilechooserwidget: show drop hints on gtkplacessidebar
Now with the API addition on gtkplacessidebar, we can show some
hints for the drop targets.
https://bugzilla.gnome.org/show_bug.cgi?id=747793
Diffstat (limited to 'gtk/gtkfilechooserwidget.c')
-rw-r--r-- | gtk/gtkfilechooserwidget.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index 232640c11f..ec1645a367 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -1645,6 +1645,16 @@ file_list_drag_drop_cb (GtkWidget *widget, return TRUE; } +static void +file_list_drag_begin_cb (GtkWidget *widget, + GdkDragContext *context, + GtkFileChooserWidget *impl) +{ + gtk_places_sidebar_set_drop_targets_visible (GTK_PLACES_SIDEBAR (impl->priv->places_sidebar), + TRUE, + context); +} + /* Disable the normal tree drag motion handler, it makes it look like you're dropping the dragged item onto a tree item */ static gboolean @@ -1659,6 +1669,19 @@ file_list_drag_motion_cb (GtkWidget *widget, return TRUE; } +static void +file_list_drag_end_cb (GtkWidget *widget, + GdkDragContext *context, + gpointer user_data) +{ + GtkFileChooserWidget *impl; + + impl = GTK_FILE_CHOOSER_WIDGET (user_data); + gtk_places_sidebar_set_drop_targets_visible (GTK_PLACES_SIDEBAR (impl->priv->places_sidebar), + FALSE, + context); +} + /* Sensitizes the "Copy file’s location" and other context menu items if there is actually * a selection active. */ @@ -7518,7 +7541,9 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class) gtk_widget_class_bind_template_callback (widget_class, file_list_query_tooltip_cb); gtk_widget_class_bind_template_callback (widget_class, list_button_press_event_cb); gtk_widget_class_bind_template_callback (widget_class, list_row_activated); + gtk_widget_class_bind_template_callback (widget_class, file_list_drag_begin_cb); gtk_widget_class_bind_template_callback (widget_class, file_list_drag_motion_cb); + gtk_widget_class_bind_template_callback (widget_class, file_list_drag_end_cb); gtk_widget_class_bind_template_callback (widget_class, list_selection_changed); gtk_widget_class_bind_template_callback (widget_class, list_cursor_changed); gtk_widget_class_bind_template_callback (widget_class, filter_combo_changed); |