Mercurial > geeqie
diff src/view_dir_tree.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 | 4b2d7f9af171 |
children | 48c8e49b571c |
line wrap: on
line diff
--- a/src/view_dir_tree.c Sun Apr 20 20:35:26 2008 +0000 +++ b/src/view_dir_tree.c Sun Apr 20 21:30:36 2008 +0000 @@ -832,7 +832,7 @@ /* clicking this region should automatically reveal an expander, if necessary * treeview bug: the expander will not expand until a button_motion_event highlights it. */ - if (bevent->button == 1 && + if (bevent->button == MOUSE_BUTTON_LEFT && !left_of_expander && !gtk_tree_view_row_expanded(GTK_TREE_VIEW(vd->view), tpath)) { @@ -850,14 +850,14 @@ vd->click_fd = (nd) ? nd->fd : NULL; vd_color_set(vd, vd->click_fd, TRUE); - if (bevent->button == 3) + if (bevent->button == MOUSE_BUTTON_RIGHT) { vd->popup = vd_pop_menu(vd, vd->click_fd); gtk_menu_popup(GTK_MENU(vd->popup), NULL, NULL, NULL, NULL, bevent->button, bevent->time); } - return (bevent->button != 1); + return (bevent->button != MOUSE_BUTTON_LEFT); } static void vdtree_row_expanded(GtkTreeView *treeview, GtkTreeIter *iter, GtkTreePath *tpath, gpointer data)