Skip to content

Commit 9c0bdaa

Browse files
committed
list-view: Remove remaining unused 'drop zone' code.
1 parent 32ab5b1 commit 9c0bdaa

3 files changed

Lines changed: 2 additions & 108 deletions

File tree

src/nemo-list-view.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1782,17 +1782,10 @@ get_file_for_path_callback (NemoTreeViewDragDest *dest,
17821782
gpointer user_data)
17831783
{
17841784
NemoListView *view;
1785-
NemoFile *file;
17861785

17871786
view = NEMO_LIST_VIEW (user_data);
17881787

1789-
file = nemo_list_model_file_for_path (view->details->model, path);
1790-
1791-
if (!view->details->drag_started) {
1792-
g_signal_emit_by_name (NEMO_VIEW (view), "show-drop-bar");
1793-
}
1794-
1795-
return file;
1788+
return nemo_list_model_file_for_path (view->details->model, path);
17961789
}
17971790

17981791
/* Handles an URL received from Mozilla */

src/nemo-window-slot.c

Lines changed: 1 addition & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -276,23 +276,6 @@ floating_bar_action_cb (NemoFloatingBar *floating_bar,
276276
}
277277
}
278278

279-
static void
280-
on_drop_bar_state_changed (GtkWidget *widget,
281-
GtkStateFlags flags,
282-
gpointer user_data)
283-
{
284-
NemoWindowSlot *slot = NEMO_WINDOW_SLOT (user_data);
285-
286-
if (gtk_widget_get_state_flags (widget) & GTK_STATE_FLAG_DROP_ACTIVE) {
287-
gtk_image_set_from_icon_name (GTK_IMAGE (slot->drop_bar_icon), "folder-drag-accept-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR);
288-
gtk_widget_show (slot->drop_bar_label);
289-
} else {
290-
gtk_image_set_from_icon_name (GTK_IMAGE (slot->drop_bar_icon), "folder-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR);
291-
gtk_widget_hide (slot->drop_bar_label);
292-
}
293-
294-
}
295-
296279
static GtkWidget *
297280
create_nsr_box (void)
298281
{
@@ -324,7 +307,7 @@ create_nsr_box (void)
324307
static void
325308
nemo_window_slot_init (NemoWindowSlot *slot)
326309
{
327-
GtkWidget *extras_vbox, *content;
310+
GtkWidget *extras_vbox;
328311

329312
gtk_orientable_set_orientation (GTK_ORIENTABLE (slot),
330313
GTK_ORIENTATION_VERTICAL);
@@ -359,33 +342,6 @@ nemo_window_slot_init (NemoWindowSlot *slot)
359342
g_signal_connect (slot->floating_bar, "action",
360343
G_CALLBACK (floating_bar_action_cb), slot);
361344

362-
slot->drop_bar = gtk_info_bar_new ();
363-
g_object_set (G_OBJECT (slot->drop_bar),
364-
"halign", GTK_ALIGN_FILL,
365-
"valign", GTK_ALIGN_START,
366-
"message-type", GTK_MESSAGE_OTHER,
367-
"revealed", FALSE,
368-
"name", "drop-bar",
369-
NULL);
370-
gtk_style_context_add_class (gtk_widget_get_style_context (slot->drop_bar), "view");
371-
372-
slot->drop_bar_icon = gtk_image_new_from_icon_name ("folder-symbolic", GTK_ICON_SIZE_SMALL_TOOLBAR);
373-
slot->drop_bar_label = gtk_label_new (_("Drop into current location"));
374-
gtk_label_set_xalign (GTK_LABEL (slot->drop_bar_label), 0.0);
375-
gtk_style_context_add_class (gtk_widget_get_style_context (slot->drop_bar_label), "dim-label");
376-
377-
content = gtk_info_bar_get_content_area (GTK_INFO_BAR (slot->drop_bar));
378-
gtk_container_set_border_width (GTK_CONTAINER (content), 3);
379-
gtk_box_set_center_widget (GTK_BOX (content), slot->drop_bar_icon);
380-
gtk_box_pack_start (GTK_BOX (content), slot->drop_bar_label, FALSE, FALSE, 4);
381-
382-
// Make children visible but then hide the bar overall. It will be made visible in the
383-
// show-drop-bar callback, otherwise it shows up on the desktop.
384-
gtk_widget_show_all (slot->drop_bar);
385-
gtk_widget_hide (slot->drop_bar);
386-
387-
gtk_overlay_add_overlay (GTK_OVERLAY (slot->view_overlay), slot->drop_bar);
388-
389345
slot->cache_bar = NULL;
390346

391347
slot->title = g_strdup (_("Loading..."));
@@ -428,7 +384,6 @@ nemo_window_slot_dispose (GObject *object)
428384
nemo_window_slot_clear_forward_list (slot);
429385
nemo_window_slot_clear_back_list (slot);
430386
nemo_window_slot_remove_extra_location_widgets (slot);
431-
g_clear_handle_id (&slot->drop_bar_hide_timeout_id, g_source_remove);
432387

433388
if (slot->content_view) {
434389
widget = GTK_WIDGET (slot->content_view);
@@ -665,55 +620,6 @@ nemo_window_slot_set_show_thumbnails (NemoWindowSlot *slot,
665620
nemo_directory_unref (directory);
666621
}
667622

668-
static gboolean
669-
update_drop_bar (gpointer data)
670-
{
671-
g_return_val_if_fail (NEMO_IS_WINDOW_SLOT (data), G_SOURCE_REMOVE);
672-
NemoWindowSlot *slot = NEMO_WINDOW_SLOT (data);
673-
674-
GdkSeat *seat;
675-
GdkDevice *device;
676-
GtkAllocation alloc;
677-
gboolean in_drop_bar;
678-
679-
in_drop_bar = FALSE;
680-
seat = gdk_display_get_default_seat (gdk_display_get_default ());
681-
682-
if (seat != NULL) {
683-
device = gdk_seat_get_pointer (seat);
684-
685-
if (device != NULL) {
686-
gint x, y;
687-
gtk_widget_get_allocation (slot->drop_bar, &alloc);
688-
gdk_window_get_device_position (gtk_widget_get_window (slot->drop_bar), device, &x, &y, NULL);
689-
690-
in_drop_bar = (x >= alloc.x && x <= alloc.x + alloc.width) && (y >= alloc.y && y <= alloc.y + alloc.height);
691-
}
692-
}
693-
694-
if (in_drop_bar) {
695-
return G_SOURCE_CONTINUE;
696-
}
697-
698-
gtk_info_bar_set_revealed (GTK_INFO_BAR (slot->drop_bar), FALSE);
699-
700-
slot->drop_bar_hide_timeout_id = 0;
701-
return G_SOURCE_REMOVE;
702-
}
703-
704-
static void
705-
show_drop_bar_cb (NemoView *view,
706-
gpointer user_data)
707-
{
708-
NemoWindowSlot *slot = NEMO_WINDOW_SLOT (user_data);
709-
710-
gtk_widget_show (slot->drop_bar);
711-
gtk_info_bar_set_revealed (GTK_INFO_BAR (slot->drop_bar), TRUE);
712-
713-
g_clear_handle_id (&slot->drop_bar_hide_timeout_id, g_source_remove);
714-
slot->drop_bar_hide_timeout_id = g_timeout_add_seconds (1, (GSourceFunc) update_drop_bar, slot);
715-
}
716-
717623
void
718624
nemo_window_slot_set_content_view_widget (NemoWindowSlot *slot,
719625
NemoView *new_view)
@@ -726,7 +632,6 @@ nemo_window_slot_set_content_view_widget (NemoWindowSlot *slot,
726632
if (slot->content_view != NULL) {
727633
/* disconnect old view */
728634
g_signal_handlers_disconnect_by_func (slot->content_view, G_CALLBACK (view_end_loading_cb), slot);
729-
g_signal_handlers_disconnect_by_func (slot->content_view, G_CALLBACK (show_drop_bar_cb), slot);
730635

731636
nemo_window_disconnect_content_view (window, slot->content_view);
732637

src/nemo-window-slot.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,13 +70,9 @@ struct NemoWindowSlot {
7070
GtkWidget *floating_bar;
7171
GtkWidget *cache_bar;
7272
GtkWidget *no_search_results_box;
73-
GtkWidget *drop_bar;
74-
GtkWidget *drop_bar_icon;
75-
GtkWidget *drop_bar_label;
7673

7774
guint set_status_timeout_id;
7875
guint loading_timeout_id;
79-
guint drop_bar_hide_timeout_id;
8076

8177
NemoView *content_view;
8278
NemoView *new_content_view;

0 commit comments

Comments
 (0)