diff --git a/ChangeLog b/ChangeLog index aed7a8d5de..6eb5129e9f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-03-16 Matthias Clasen + + * gtk/gtkprintunixdialog.c (printer_added_cb): Scroll to + make the selected printer visible. (#418403, Nickolay V. Shmyrev, + patch by Christian Persch) + 2007-03-15 Federico Mena Quintero Merged from gtk-2-10: diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c index 26d9d3f552..47d6c22e7a 100644 --- a/gtk/gtkprintunixdialog.c +++ b/gtk/gtkprintunixdialog.c @@ -427,6 +427,7 @@ printer_added_cb (GtkPrintBackend *backend, GtkPrintUnixDialogPrivate *priv = dialog->priv; GtkTreeIter iter, filter_iter; GtkTreeSelection *selection; + GtkTreePath *path; gtk_list_store_append (GTK_LIST_STORE (priv->printer_list), &iter); @@ -446,7 +447,8 @@ printer_added_cb (GtkPrintBackend *backend, gtk_tree_model_filter_convert_child_iter_to_iter (priv->printer_list_filter, &filter_iter, &iter); - + path = gtk_tree_model_get_path (GTK_TREE_MODEL (priv->printer_list_filter), &filter_iter); + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->printer_treeview)); if (priv->waiting_for_printer != NULL && @@ -455,6 +457,8 @@ printer_added_cb (GtkPrintBackend *backend, { priv->internal_printer_change = TRUE; gtk_tree_selection_select_iter (selection, &filter_iter); + gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (priv->printer_treeview), + path, NULL, TRUE, 0.5, 0.0); priv->internal_printer_change = FALSE; g_free (priv->waiting_for_printer); priv->waiting_for_printer = NULL; @@ -464,8 +468,12 @@ printer_added_cb (GtkPrintBackend *backend, { priv->internal_printer_change = TRUE; gtk_tree_selection_select_iter (selection, &filter_iter); + gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (priv->printer_treeview), + path, NULL, TRUE, 0.5, 0.0); priv->internal_printer_change = FALSE; } + + gtk_tree_path_free (path); } static void