@@ -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-
296279static GtkWidget *
297280create_nsr_box (void )
298281{
@@ -324,7 +307,7 @@ create_nsr_box (void)
324307static void
325308nemo_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-
717623void
718624nemo_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
0 commit comments