diff src/view_file_list.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/view_file_list.c	Sun Apr 20 20:35:26 2008 +0000
+++ b/src/view_file_list.c	Sun Apr 20 21:30:36 2008 +0000
@@ -715,7 +715,7 @@
 		GtkTreeModel *store;
 		col_idx = GPOINTER_TO_INT(g_object_get_data (G_OBJECT(column), "column_store_idx"));
 
-		if (bevent->button == 1 &&
+		if (bevent->button == MOUSE_BUTTON_LEFT &&
 		    col_idx >= FILE_COLUMN_MARKS && col_idx <= FILE_COLUMN_MARKS_LAST)
 			return FALSE;
 
@@ -731,7 +731,7 @@
 
 	vfl->click_fd = fd;
 
-	if (bevent->button == 3)
+	if (bevent->button == MOUSE_BUTTON_RIGHT)
 		{
 		vfl->popup = vflist_pop_menu(vfl, vfl->click_fd, col_idx);
 		gtk_menu_popup(GTK_MENU(vfl->popup), NULL, NULL, NULL, NULL,
@@ -741,7 +741,7 @@
 
 	if (!fd) return FALSE;
 
-	if (bevent->button == 2)
+	if (bevent->button == MOUSE_BUTTON_MIDDLE)
 		{
 		if (!vflist_row_is_selected(vfl, fd))
 			{
@@ -751,7 +751,7 @@
 		}
 
 
-	if (bevent->button == 1 && bevent->type == GDK_BUTTON_PRESS &&
+	if (bevent->button == MOUSE_BUTTON_LEFT && bevent->type == GDK_BUTTON_PRESS &&
 	    !(bevent->state & GDK_SHIFT_MASK ) &&
 	    !(bevent->state & GDK_CONTROL_MASK ) &&
 	    vflist_row_is_selected(vfl, fd))
@@ -761,7 +761,7 @@
 		}
 
 #if 0
-	if (bevent->button == 1 && bevent->type == GDK_2BUTTON_PRESS)
+	if (bevent->button == MOUSE_BUTTON_LEFT && bevent->type == GDK_2BUTTON_PRESS)
 		{
 		if (vfl->layout) layout_image_full_screen_start(vfl->layout);
 		}
@@ -777,12 +777,12 @@
 	GtkTreeIter iter;
 	FileData *fd = NULL;
 
-	if (bevent->button == 2)
+	if (bevent->button == MOUSE_BUTTON_MIDDLE)
 		{
 		vflist_color_set(vfl, vfl->click_fd, FALSE);
 		}
 
-	if (bevent->button != 1 && bevent->button != 2)
+	if (bevent->button != MOUSE_BUTTON_LEFT && bevent->button != MOUSE_BUTTON_MIDDLE)
 		{
 		return TRUE;
 		}
@@ -799,7 +799,7 @@
 		gtk_tree_path_free(tpath);
 		}
 
-	if (bevent->button == 2)
+	if (bevent->button == MOUSE_BUTTON_MIDDLE)
 		{
 		if (fd && vfl->click_fd == fd)
 			{