diff console/libgnt/gnttree.c @ 14384:4a901f5d1312

[gaim-migrate @ 17090] Contactize the buddylist. But there's no way to move a buddy in some contact yet. Drag-dropping might be possible, but I'll probably go with a menuitem in the context-menu. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Thu, 31 Aug 2006 00:58:50 +0000
parents a7e29c0b51f4
children 3ac156db9cb6
line wrap: on
line diff
--- a/console/libgnt/gnttree.c	Wed Aug 30 23:29:42 2006 +0000
+++ b/console/libgnt/gnttree.c	Thu Aug 31 00:58:50 2006 +0000
@@ -111,7 +111,7 @@
 
 	while(row->next)
 		row = row->next;
-	if (row->child)
+	if (!row->collapsed && row->child)
 		row = get_last_child(row->child);
 	return row;
 }
@@ -1215,3 +1215,12 @@
 	tree->compare = func;
 }
 
+void gnt_tree_set_expanded(GntTree *tree, void *key, gboolean expanded)
+{
+	GntTreeRow *row = g_hash_table_lookup(tree->hash, key);
+	if (row) {
+		row->collapsed = !expanded;
+		if (GNT_WIDGET(tree)->window)
+			gnt_widget_draw(GNT_WIDGET(tree));
+	}
+}