filechooserwidget: Drop name column from treeview
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Sat, 8 Oct 2022 11:22:53 +0000 (08:22 -0300)
committerMatthias Clasen <mclasen@redhat.com>
Fri, 21 Oct 2022 02:34:40 +0000 (22:34 -0400)
It is now entirely handled by the column view.

gtk/gtkfilechooserwidget.c
gtk/ui/gtkfilechooserwidget.ui

index 711354a675b66e7c36e3c7cde2049630614cabe8..c809b46155d747f611afc47b261d53f413bcadce 100644 (file)
@@ -275,7 +275,6 @@ struct _GtkFileChooserWidget
   GFile *current_folder;
   GFile *renamed_file;
 
-  GtkTreeViewColumn *list_name_column;
   GtkTreeViewColumn *list_time_column;
   GtkCellRenderer *list_date_renderer;
   GtkCellRenderer *list_time_renderer;
@@ -1370,7 +1369,7 @@ rename_selected_cb (GtkTreeModel *model,
                       -1);
 
   gtk_tree_view_get_cell_area (GTK_TREE_VIEW (impl->browse_files_tree_view),
-                               path, impl->list_name_column, &rect);
+                               path, impl->list_size_column, &rect);
 
   gtk_tree_view_convert_bin_window_to_widget_coords (GTK_TREE_VIEW (impl->browse_files_tree_view),
                                                      rect.x, rect.y,
@@ -2150,7 +2149,6 @@ file_list_set_sort_column_ids (GtkFileChooserWidget *impl)
 
   gtk_tree_view_set_search_column (GTK_TREE_VIEW (impl->browse_files_tree_view), -1);
 
-  gtk_tree_view_column_set_sort_column_id (impl->list_name_column, MODEL_COL_NAME);
   gtk_tree_view_column_set_sort_column_id (impl->list_time_column, MODEL_COL_TIME);
   gtk_tree_view_column_set_sort_column_id (impl->list_size_column, MODEL_COL_SIZE);
   gtk_tree_view_column_set_sort_column_id (impl->list_type_column, MODEL_COL_TYPE);
@@ -3857,7 +3855,6 @@ update_columns (GtkFileChooserWidget *impl,
   if (need_resize)
     {
       /* This undoes user resizing of columns when the columns change. */
-      gtk_tree_view_column_set_expand (impl->list_name_column, TRUE);
       gtk_tree_view_column_set_expand (impl->list_location_column, TRUE);
       gtk_tree_view_columns_autosize (GTK_TREE_VIEW (impl->browse_files_tree_view));
     }
@@ -6575,7 +6572,6 @@ search_setup_model (GtkFileChooserWidget *impl)
   gtk_tree_view_set_model (GTK_TREE_VIEW (impl->browse_files_tree_view),
                            GTK_TREE_MODEL (impl->search_model));
 
-  gtk_tree_view_column_set_sort_column_id (impl->list_name_column, -1);
   gtk_tree_view_column_set_sort_column_id (impl->list_time_column, -1);
   gtk_tree_view_column_set_sort_column_id (impl->list_size_column, -1);
   gtk_tree_view_column_set_sort_column_id (impl->list_type_column, -1);
@@ -6815,7 +6811,6 @@ recent_start_loading (GtkFileChooserWidget *impl)
                            GTK_TREE_MODEL (impl->recent_model));
   gtk_tree_view_set_search_column (GTK_TREE_VIEW (impl->browse_files_tree_view), -1);
 
-  gtk_tree_view_column_set_sort_column_id (impl->list_name_column, -1);
   gtk_tree_view_column_set_sort_column_id (impl->list_time_column, -1);
   gtk_tree_view_column_set_sort_column_id (impl->list_size_column, -1);
   gtk_tree_view_column_set_sort_column_id (impl->list_type_column, -1);
@@ -7632,7 +7627,6 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class)
   gtk_widget_class_bind_template_child (widget_class, GtkFileChooserWidget, location_entry_box);
   gtk_widget_class_bind_template_child (widget_class, GtkFileChooserWidget, search_entry);
   gtk_widget_class_bind_template_child (widget_class, GtkFileChooserWidget, search_spinner);
-  gtk_widget_class_bind_template_child (widget_class, GtkFileChooserWidget, list_name_column);
   gtk_widget_class_bind_template_child (widget_class, GtkFileChooserWidget, list_time_column);
   gtk_widget_class_bind_template_child (widget_class, GtkFileChooserWidget, list_date_renderer);
   gtk_widget_class_bind_template_child (widget_class, GtkFileChooserWidget, list_time_renderer);
index 09fb17af368fbb5a8847eef9dc7b92d3435806e9..e30550be1f6d6fea3a33b08f05632adcb4afb853 100644 (file)
                                                 <signal name="changed" handler="list_selection_changed" swapped="no"/>
                                               </object>
                                             </child>
-                                            <child>
-                                              <object class="GtkTreeViewColumn" id="list_name_column">
-                                                <property name="title" translatable="yes">Name</property>
-                                                <property name="resizable">1</property>
-                                                <property name="expand">1</property>
-                                              </object>
-                                            </child>
                                             <child>
                                               <object class="GtkTreeViewColumn" id="list_location_column">
                                                 <property name="title" translatable="yes">Location</property>