]> git.0d.be Git - empathy.git/commitdiff
accounts_dialog_set_selected_account: scroll to the selected account
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 28 Feb 2011 12:13:52 +0000 (13:13 +0100)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 28 Feb 2011 12:31:45 +0000 (13:31 +0100)
src/empathy-accounts-dialog.c

index 3dc600a896421cde667356a730e2c520e921f44e..501b93648df2ba76cbe0908efddbe66afb0cfc7a 100644 (file)
@@ -1943,7 +1943,20 @@ accounts_dialog_set_selected_account (EmpathyAccountsDialog *dialog,
 
   selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->treeview));
   if (accounts_dialog_get_account_iter (dialog, account, &iter))
-    gtk_tree_selection_select_iter (selection, &iter);
+    {
+      GtkTreePath *path;
+      GtkTreeModel *model;
+
+      gtk_tree_selection_select_iter (selection, &iter);
+
+      model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->treeview));
+      path = gtk_tree_model_get_path (model, &iter);
+
+      gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW (priv->treeview), path, NULL,
+          TRUE, 0, 0.5);
+
+      gtk_tree_path_free (path);
+    }
 }
 
 static void