[gtk/gbsneto/filechooser-column-view: 70/105] filechooserwidget: Stop centering on selected files
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/gbsneto/filechooser-column-view: 70/105] filechooserwidget: Stop centering on selected files
- Date: Wed, 12 Oct 2022 20:42:36 +0000 (UTC)
commit 1369d139543064fd6821873aafa15bdef06a962e
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sat Oct 8 15:18:13 2022 -0300
filechooserwidget: Stop centering on selected files
gtk/gtkfilechooserwidget.c | 41 -----------------------------------------
1 file changed, 41 deletions(-)
---
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index ef83d19f19..36cfb0287d 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -482,7 +482,6 @@ static void path_bar_clicked (GtkPathBar *path_bar,
GtkFileChooserWidget *impl);
static void load_remove_timer (GtkFileChooserWidget *impl, LoadState new_load_state);
-static void browse_files_center_selected_row (GtkFileChooserWidget *impl);
static void location_switch_to_path_bar (GtkFileChooserWidget *impl);
@@ -3550,43 +3549,6 @@ browse_files_select_first_row (GtkFileChooserWidget *impl)
gtk_tree_path_free (path);
}
-struct center_selected_row_closure {
- GtkFileChooserWidget *impl;
- gboolean already_centered;
-};
-
-/* Callback used from gtk_tree_selection_selected_foreach(); centers the
- * selected row in the tree view.
- */
-static void
-center_selected_row_foreach_cb (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer data)
-{
- struct center_selected_row_closure *closure = data;
-
- if (closure->already_centered)
- return;
-
- gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (closure->impl->browse_files_tree_view), path, NULL, TRUE,
0.5, 0.0);
- closure->already_centered = TRUE;
-}
-
-/* Centers the selected row in the tree view */
-static void
-browse_files_center_selected_row (GtkFileChooserWidget *impl)
-{
- struct center_selected_row_closure closure;
- GtkTreeSelection *selection;
-
- closure.impl = impl;
- closure.already_centered = FALSE;
-
- selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (impl->browse_files_tree_view));
- gtk_tree_selection_selected_foreach (selection, center_selected_row_foreach_cb, &closure);
-}
-
static gboolean
show_and_select_files (GtkFileChooserWidget *impl,
GSList *files)
@@ -3667,8 +3629,6 @@ show_and_select_files (GtkFileChooserWidget *impl,
}
}
- browse_files_center_selected_row (impl);
-
return selected_a_file;
}
@@ -3683,7 +3643,6 @@ pending_select_files_process (GtkFileChooserWidget *impl)
{
show_and_select_files (impl, impl->pending_select_files);
pending_select_files_free (impl);
- browse_files_center_selected_row (impl);
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]