[nautilus/wip/antoniof/flow-box-preparation: 36/46] view-icon-controller: Stop handling ::child-activated




commit 1e62967447a21e99780346d3a1d2d5b71de71ef0
Author: António Fernandes <antoniof gnome org>
Date:   Sat Dec 18 13:56:51 2021 +0000

    view-icon-controller: Stop handling ::child-activated
    
    Clicks are handled in a different way now, and keyboard accelerators
    in NautilusFilesView take care of the rest already, so this is useless.
    
    It's even worse than useless, because Ctrl+Space is still going to open
    the file in addition to selecting it!

 src/nautilus-view-icon-controller.c | 22 ----------------------
 1 file changed, 22 deletions(-)
---
diff --git a/src/nautilus-view-icon-controller.c b/src/nautilus-view-icon-controller.c
index b0b512068..e8549e351 100644
--- a/src/nautilus-view-icon-controller.c
+++ b/src/nautilus-view-icon-controller.c
@@ -1033,24 +1033,6 @@ finalize (GObject *object)
     G_OBJECT_CLASS (nautilus_view_icon_controller_parent_class)->finalize (object);
 }
 
-static void
-on_child_activated (GtkFlowBox      *flow_box,
-                    GtkFlowBoxChild *child,
-                    gpointer         user_data)
-{
-    NautilusViewIconController *self = NAUTILUS_VIEW_ICON_CONTROLLER (user_data);
-    NautilusViewItemModel *item_model;
-    NautilusFile *file;
-    g_autoptr (GList) list = NULL;
-
-    item_model = g_list_model_get_item (G_LIST_MODEL (self->model),
-                                        gtk_flow_box_child_get_index (child));
-    file = nautilus_view_item_model_get_file (item_model);
-    list = g_list_append (list, file);
-
-    nautilus_files_view_activate_files (NAUTILUS_FILES_VIEW (self), list, 0, TRUE);
-}
-
 static void
 on_ui_selected_children_changed (GtkFlowBox *box,
                                  gpointer    user_data)
@@ -1102,9 +1084,6 @@ create_view_ui (NautilusViewIconController *self)
     gtk_widget_set_valign (widget, GTK_ALIGN_START);
 
     flowbox = GTK_FLOW_BOX (widget);
-    /* We don't use GtkFlowBox's single click mode because it doesn't match our
-     * expected behavior. Instead, we roll our own self->single_click_mode. */
-    gtk_flow_box_set_activate_on_single_click (flowbox, FALSE);
     gtk_flow_box_set_max_children_per_line (flowbox, 20);
     gtk_flow_box_set_selection_mode (flowbox, GTK_SELECTION_MULTIPLE);
     gtk_flow_box_set_homogeneous (flowbox, FALSE);
@@ -1139,7 +1118,6 @@ constructed (GObject *object)
     gtk_flow_box_set_vadjustment (self->view_ui, vadjustment);
     gtk_widget_show (GTK_WIDGET (self->view_ui));
 
-    g_signal_connect (self->view_ui, "child-activated", (GCallback) on_child_activated, self);
     g_signal_connect (self->view_ui, "selected-children-changed", (GCallback) 
on_ui_selected_children_changed, self);
 
     gtk_flow_box_bind_model (self->view_ui,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]