Since ::drag-leave gets emitted before ::drag-drop, we can't just remove the drop feedback row
in drag-leave, as we *need* it during drag-drop. So, we use the same trick as in testdnd.c - we
install a timeout handler in our drag-leave callback, and remove the feedback in the timeout callback.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
This lets us keep the new_bookmark_index untouched even when the drop state goes from armed to unarmed.
That will in turn let us drop in the right place...
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
This makes the feedback accurate and without hysteresis. Haven't I written this code ten times before?
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
For now it is the old, simple call to gtk_tree_view_set_drag_dest_row(). We'll do something
fancier in the following commits.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
We want to show a little animation when a DnD operation is happening and the user hovers
between existing bookmarks. The animation should indicate the user that he's about to
create a new bookmark from the file right there.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
The creation is async, and the sidebar could be destroyed while the D-Bus proxy is being created.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
It's not friendly to bindings, and we didn't need an inout parameter anyway.
We use a simple return value from the signal handler now.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
Unmounted volumes don't have a URI yet, so we can use that to distinguish them
from within the DnD code.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
Instead of having an accept_uri_drops flag, we'll always advertise as accepting URI drops.
However, we'll see if the caller actually handles the drag-action-requested signal. If it
does, we'll indeed allow performing file operations when URIs are dropped. Otherwise,
we'll only allow creating bookmarks from dragged URIs.
Dragging URIs directly into a places item will cause the sidebar to check if the caller
allows file operations. Dragging URIs between places items will cause the sidebar
to create bookmarks for those URIs instead.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
This keeps the drop indicator line from 'sticking' if you drag a bookmark above
the Bookmarks heading.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
The rest of the public API works in terms of GFile, so remove this last remnant
of passing URIs around.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
We used to have set_current_location() and get_selected_location(), with confusing
semantics. Now they are symmetric, with the exception that if set_location() is
called with a location that is not shown in the sidebar, then it will both clear
the selection in the list and make get_selection() return NULL.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
This lets us handle the 'Open in new tab' and 'Open in new window' menu items
on our own, and allows callers to have less code to deal with each mode.
Signed-off-by: Federico Mena Quintero <federico@gnome.org>
This lets us remove two entry points, gtk_places_sidebar_set_show_trash(),
and gtk_places_sidebar_set_trash_is_full().
Signed-off-by: Federico Mena Quintero <federico@gnome.org>