Mercurial > geeqie
diff src/pixbuf-renderer.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/pixbuf-renderer.c Sun Apr 20 20:35:26 2008 +0000 +++ b/src/pixbuf-renderer.c Sun Apr 20 21:30:36 2008 +0000 @@ -3593,7 +3593,7 @@ switch (bevent->button) { - case 1: + case MOUSE_BUTTON_LEFT: pr->in_drag = TRUE; pr->drag_last_x = bevent->x; pr->drag_last_y = bevent->y; @@ -3603,10 +3603,10 @@ NULL, NULL, bevent->time); gtk_grab_add(widget); break; - case 2: + case MOUSE_BUTTON_MIDDLE: pr->drag_moved = 0; break; - case 3: + case MOUSE_BUTTON_RIGHT: pr_clicked_signal(pr, bevent); break; default: @@ -3643,11 +3643,11 @@ if (pr->drag_moved < PR_DRAG_SCROLL_THRESHHOLD) { - if (bevent->button == 1 && (bevent->state & GDK_SHIFT_MASK)) + if (bevent->button == MOUSE_BUTTON_LEFT && (bevent->state & GDK_SHIFT_MASK)) { pr_scroller_start(pr, bevent->x, bevent->y); } - else if (bevent->button == 1 || bevent->button == 2) + else if (bevent->button == MOUSE_BUTTON_LEFT || bevent->button == MOUSE_BUTTON_MIDDLE) { pr_clicked_signal(pr, bevent); }