diff console/gntblist.c @ 14477:ca36763497d9

[gaim-migrate @ 17195] Build libgnt with ncurses if ncursesw is not found. I uninstalled ncursesw and it's still working for me .. of course, with no wide-character support. Improve the mouse support a bit. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 09 Sep 2006 02:19:16 +0000
parents feedb7828791
children 5ac8f22e7b08
line wrap: on
line diff
--- a/console/gntblist.c	Fri Sep 08 22:47:36 2006 +0000
+++ b/console/gntblist.c	Sat Sep 09 02:19:16 2006 +0000
@@ -1160,6 +1160,8 @@
 static void
 selection_changed(GntWidget *widget, gpointer old, gpointer current, GGBlist *ggblist)
 {
+	if (ggblist->context)
+		remove_context_menu(ggblist);
 	draw_tooltip(ggblist);
 }
 
@@ -1568,6 +1570,15 @@
 	return ret;
 }
 
+static gboolean
+blist_clicked(GntTree *tree, GntMouseEvent event, int x, int y, gpointer ggblist)
+{
+	if (event == GNT_RIGHT_MOUSE_DOWN) {
+		draw_context_menu(ggblist);
+	}
+	return FALSE;
+}
+
 void gg_blist_show()
 {
 	if (ggblist)
@@ -1626,6 +1637,7 @@
 
 	g_signal_connect(G_OBJECT(ggblist->tree), "selection_changed", G_CALLBACK(selection_changed), ggblist);
 	g_signal_connect(G_OBJECT(ggblist->tree), "key_pressed", G_CALLBACK(key_pressed), ggblist);
+	g_signal_connect_after(G_OBJECT(ggblist->tree), "clicked", G_CALLBACK(blist_clicked), ggblist);
 	g_signal_connect(G_OBJECT(ggblist->tree), "activate", G_CALLBACK(selection_activate), ggblist);
 	g_signal_connect_data(G_OBJECT(ggblist->tree), "gained-focus", G_CALLBACK(draw_tooltip),
 				ggblist, 0, G_CONNECT_AFTER | G_CONNECT_SWAPPED);