Commit 787ee3e7 authored by Federico Mena Quintero's avatar Federico Mena Quintero Committed by Federico Mena Quintero

Merged from gtk-2-4:

2004-12-08  Federico Mena Quintero  <federico@ximian.com>

	Merged from gtk-2-4:

	* gtk/gtkfilechooserdefault.c (pending_op_process): Center the
	selected row so that it's easily visible.
parent 057ab5a4
2004-12-08 Federico Mena Quintero <federico@ximian.com>
Merged from gtk-2-4:
* gtk/gtkfilechooserdefault.c (pending_op_process): Center the
selected row so that it's easily visible.
2004-12-08 Matthias Clasen <mclasen@redhat.com>
Fix #111031, reported by Padraig O'Briain:
......
2004-12-08 Federico Mena Quintero <federico@ximian.com>
Merged from gtk-2-4:
* gtk/gtkfilechooserdefault.c (pending_op_process): Center the
selected row so that it's easily visible.
2004-12-08 Matthias Clasen <mclasen@redhat.com>
Fix #111031, reported by Padraig O'Briain:
......
2004-12-08 Federico Mena Quintero <federico@ximian.com>
Merged from gtk-2-4:
* gtk/gtkfilechooserdefault.c (pending_op_process): Center the
selected row so that it's easily visible.
2004-12-08 Matthias Clasen <mclasen@redhat.com>
Fix #111031, reported by Padraig O'Briain:
......
2004-12-08 Federico Mena Quintero <federico@ximian.com>
Merged from gtk-2-4:
* gtk/gtkfilechooserdefault.c (pending_op_process): Center the
selected row so that it's easily visible.
2004-12-08 Matthias Clasen <mclasen@redhat.com>
Fix #111031, reported by Padraig O'Briain:
......
......@@ -4265,6 +4265,31 @@ browse_files_select_first_row (GtkFileChooserDefault *impl)
gtk_tree_path_free (path);
}
/* 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)
{
GtkFileChooserDefault *impl;
impl = GTK_FILE_CHOOSER_DEFAULT (data);
gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (impl->browse_files_tree_view), path, NULL, TRUE, 0.5, 0.0);
}
/* Centers the selected row in the tree view */
static void
browse_files_center_selected_row (GtkFileChooserDefault *impl)
{
GtkTreeSelection *selection;
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, impl);
}
/* Processes the pending operation when a folder is finished loading */
static void
pending_op_process (GtkFileChooserDefault *impl)
......@@ -4281,6 +4306,7 @@ pending_op_process (GtkFileChooserDefault *impl)
gtk_file_path_free (impl->pending_select_path);
impl->pending_select_path = NULL;
impl->pending_op = PENDING_OP_NONE;
browse_files_center_selected_row (impl);
break;
case PENDING_OP_SELECT_FIRST:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment