Mercurial > geeqie
comparison src/ui_misc.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 |
comparison
equal
deleted
inserted
replaced
447:d87de3a3eb3b | 448:a73cc0fa14d0 |
---|---|
19 #include <string.h> | 19 #include <string.h> |
20 | 20 |
21 #include <gtk/gtk.h> | 21 #include <gtk/gtk.h> |
22 #include <gdk/gdkkeysyms.h> | 22 #include <gdk/gdkkeysyms.h> |
23 | 23 |
24 #include "main.h" | |
24 #include "ui_misc.h" | 25 #include "ui_misc.h" |
25 | 26 |
26 #include "ui_bookmark.h" | 27 #include "ui_bookmark.h" |
27 | 28 |
28 | 29 |
1247 | 1248 |
1248 static gint sizer_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) | 1249 static gint sizer_press_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) |
1249 { | 1250 { |
1250 SizerData *sd = data; | 1251 SizerData *sd = data; |
1251 | 1252 |
1252 if (bevent->button != 1) return FALSE; | 1253 if (bevent->button != MOUSE_BUTTON_LEFT) return FALSE; |
1253 | 1254 |
1254 sd->in_drag = TRUE; | 1255 sd->in_drag = TRUE; |
1255 sd->press_x = bevent->x_root; | 1256 sd->press_x = bevent->x_root; |
1256 sd->press_y = bevent->y_root; | 1257 sd->press_y = bevent->y_root; |
1257 | 1258 |
1268 | 1269 |
1269 static gint sizer_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) | 1270 static gint sizer_release_cb(GtkWidget *widget, GdkEventButton *bevent, gpointer data) |
1270 { | 1271 { |
1271 SizerData *sd = data; | 1272 SizerData *sd = data; |
1272 | 1273 |
1273 if (bevent->button != 1) return FALSE; | 1274 if (bevent->button != MOUSE_BUTTON_LEFT) return FALSE; |
1274 | 1275 |
1275 if (gdk_pointer_is_grabbed() && GTK_WIDGET_HAS_GRAB(sd->sizer)) | 1276 if (gdk_pointer_is_grabbed() && GTK_WIDGET_HAS_GRAB(sd->sizer)) |
1276 { | 1277 { |
1277 gtk_grab_remove(sd->sizer); | 1278 gtk_grab_remove(sd->sizer); |
1278 gdk_pointer_ungrab(bevent->time); | 1279 gdk_pointer_ungrab(bevent->time); |