comparison src/gtkblist.c @ 9632:885bba4f9d3b

[gaim-migrate @ 10476] [ 900234 ] Auto expand at bottom of buddy list has problems committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Sun, 01 Aug 2004 13:04:50 +0000
parents c001be3c330e
children bc2079a32fd9
comparison
equal deleted inserted replaced
9631:71c31e4505fd 9632:885bba4f9d3b
1025 1025
1026 static void 1026 static void
1027 gaim_gtk_blist_expand_contact_cb(GtkWidget *w, GaimBlistNode *node) 1027 gaim_gtk_blist_expand_contact_cb(GtkWidget *w, GaimBlistNode *node)
1028 { 1028 {
1029 struct _gaim_gtk_blist_node *gtknode; 1029 struct _gaim_gtk_blist_node *gtknode;
1030 GtkTreeIter iter, parent;
1030 GaimBlistNode *bnode; 1031 GaimBlistNode *bnode;
1032 GtkTreePath *path;
1031 1033
1032 if(!GAIM_BLIST_NODE_IS_CONTACT(node)) 1034 if(!GAIM_BLIST_NODE_IS_CONTACT(node))
1033 return; 1035 return;
1034 1036
1035 gtknode = (struct _gaim_gtk_blist_node *)node->ui_data; 1037 gtknode = (struct _gaim_gtk_blist_node *)node->ui_data;
1037 gtknode->contact_expanded = TRUE; 1039 gtknode->contact_expanded = TRUE;
1038 1040
1039 for(bnode = node->child; bnode; bnode = bnode->next) { 1041 for(bnode = node->child; bnode; bnode = bnode->next) {
1040 gaim_gtk_blist_update(NULL, bnode); 1042 gaim_gtk_blist_update(NULL, bnode);
1041 } 1043 }
1044
1045 /* This ensures that the bottom buddy is visible, i.e. not scrolled off the alignment */
1046 get_iter_from_node(node, &parent);
1047 gtk_tree_model_iter_nth_child(GTK_TREE_MODEL(gtkblist->treemodel), &iter, &parent,
1048 gtk_tree_model_iter_n_children(GTK_TREE_MODEL(gtkblist->treemodel), &parent) -1);
1049 path = gtk_tree_model_get_path(GTK_TREE_MODEL(gtkblist->treemodel), &iter);
1050 /* Let the treeview draw so it knows where to scroll */
1051 while (gtk_events_pending())
1052 gtk_main_iteration();
1053 gtk_tree_view_scroll_to_cell (GTK_TREE_VIEW(gtkblist->treeview), path, NULL, FALSE, 0, 0);
1054
1055
1042 gaim_gtk_blist_update(NULL, node); 1056 gaim_gtk_blist_update(NULL, node);
1057 gtk_tree_path_free(path);
1043 } 1058 }
1044 1059
1045 static void 1060 static void
1046 gaim_gtk_blist_collapse_contact_cb(GtkWidget *w, GaimBlistNode *node) 1061 gaim_gtk_blist_collapse_contact_cb(GtkWidget *w, GaimBlistNode *node)
1047 { 1062 {