diff src/collect-table.c @ 448:a73cc0fa14d0

Use explicit names for mouse buttons instead of numbers. MOUSE_BUTTON_LEFT = 1 MOUSE_BUTTON_MIDDLE = 2 MOUSE_BUTTON_RIGHT = 3 It makes the code easier to read.
author zas_
date Sun, 20 Apr 2008 21:30:36 +0000
parents ddabc4873a3f
children 48c8e49b571c
line wrap: on
line diff
--- a/src/collect-table.c	Sun Apr 20 20:35:26 2008 +0000
+++ b/src/collect-table.c	Sun Apr 20 21:30:36 2008 +0000
@@ -1427,7 +1427,7 @@
 
 	switch (bevent->button)
 		{
-		case 1:
+		case MOUSE_BUTTON_LEFT:
 			if (bevent->type == GDK_2BUTTON_PRESS)
 				{
 				if (info)
@@ -1440,7 +1440,7 @@
 				gtk_widget_grab_focus(ct->listview);
 				}
 			break;
-		case 3:
+		case MOUSE_BUTTON_RIGHT:
 			ct->popup = collection_table_popup_menu(ct, (info != NULL));
 			gtk_menu_popup(GTK_MENU(ct->popup), NULL, NULL, NULL, NULL, bevent->button, bevent->time);
 			break;
@@ -1469,7 +1469,7 @@
 		collection_table_selection_remove(ct, ct->click_info, SELECTION_PRELIGHT, NULL);
 		}
 
-	if (bevent->button == 1 &&
+	if (bevent->button == MOUSE_BUTTON_LEFT &&
 	    info && ct->click_info == info)
 		{
 		collection_table_set_focus(ct, info);
@@ -1503,7 +1503,7 @@
 				}
 			}
 		}
-	else if (bevent->button == 2 &&
+	else if (bevent->button == MOUSE_BUTTON_MIDDLE &&
 		 info && ct->click_info == info)
 		{
 		collection_table_select_util(ct, info, !INFO_SELECTED(info));