# HG changeset patch # User Sean Egan # Date 1091365490 0 # Node ID 885bba4f9d3b1166122b7c22cd97fdaff4a54b34 # Parent 71c31e4505fde1fbb4a86b89b0b7a904fdbd9dfd [gaim-migrate @ 10476] [ 900234 ] Auto expand at bottom of buddy list has problems committer: Tailor Script diff -r 71c31e4505fd -r 885bba4f9d3b src/gtkblist.c --- a/src/gtkblist.c Sun Aug 01 04:50:33 2004 +0000 +++ b/src/gtkblist.c Sun Aug 01 13:04:50 2004 +0000 @@ -1027,7 +1027,9 @@ gaim_gtk_blist_expand_contact_cb(GtkWidget *w, GaimBlistNode *node) { struct _gaim_gtk_blist_node *gtknode; + GtkTreeIter iter, parent; GaimBlistNode *bnode; + GtkTreePath *path; if(!GAIM_BLIST_NODE_IS_CONTACT(node)) return; @@ -1039,7 +1041,20 @@ for(bnode = node->child; bnode; bnode = bnode->next) { gaim_gtk_blist_update(NULL, bnode); } + + /* This ensures that the bottom buddy is visible, i.e. not scrolled off the alignment */ + get_iter_from_node(node, &parent); + gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(gtkblist->treemodel), &iter, &parent, + gtk_tree_model_iter_n_children(GTK_TREE_MODEL(gtkblist->treemodel), &parent) -1); + path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter); + /* Let the treeview draw so it knows where to scroll */ + while (gtk_events_pending()) + gtk_main_iteration(); + gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW(gtkblist->treeview), path, NULL, FALSE, 0, 0); + + gaim_gtk_blist_update(NULL, node); + gtk_tree_path_free(path); } static void