gtktreeview: Use symbolic names for button numbers

This commit is contained in:
Carlos Garcia Campos 2012-01-25 19:03:56 +01:00 committed by Carlos Garcia Campos
parent 4e41b5c5fd
commit 349b1eff03

View File

@ -2906,7 +2906,7 @@ gtk_tree_view_button_press (GtkWidget *widget,
tree_view->priv->arrow_prelit && tree_view->priv->arrow_prelit &&
gtk_tree_view_draw_expanders (tree_view)) gtk_tree_view_draw_expanders (tree_view))
{ {
if (event->button == 1) if (event->button == GDK_BUTTON_PRIMARY)
{ {
gtk_grab_add (widget); gtk_grab_add (widget);
tree_view->priv->button_pressed_node = tree_view->priv->prelight_node; tree_view->priv->button_pressed_node = tree_view->priv->prelight_node;
@ -3001,7 +3001,7 @@ gtk_tree_view_button_press (GtkWidget *widget,
_gtk_tree_view_set_focus_column (tree_view, column); _gtk_tree_view_set_focus_column (tree_view, column);
/* decide if we edit */ /* decide if we edit */
if (event->type == GDK_BUTTON_PRESS && event->button == 1 && if (event->type == GDK_BUTTON_PRESS && event->button == GDK_BUTTON_PRIMARY &&
!(event->state & gtk_accelerator_get_default_mod_mask ())) !(event->state & gtk_accelerator_get_default_mod_mask ()))
{ {
GtkTreePath *anchor; GtkTreePath *anchor;
@ -3138,7 +3138,7 @@ gtk_tree_view_button_press (GtkWidget *widget,
} }
/* Test if a double click happened on the same row. */ /* Test if a double click happened on the same row. */
if (event->button == 1 && event->type == GDK_BUTTON_PRESS) if (event->button == GDK_BUTTON_PRIMARY && event->type == GDK_BUTTON_PRESS)
{ {
int double_click_time, double_click_distance; int double_click_time, double_click_distance;
@ -3365,7 +3365,7 @@ gtk_tree_view_button_release (GtkWidget *widget,
if (tree_view->priv->button_pressed_node == NULL) if (tree_view->priv->button_pressed_node == NULL)
return FALSE; return FALSE;
if (event->button == 1) if (event->button == GDK_BUTTON_PRIMARY)
{ {
if (tree_view->priv->button_pressed_node == tree_view->priv->prelight_node && if (tree_view->priv->button_pressed_node == tree_view->priv->prelight_node &&
tree_view->priv->arrow_prelit) tree_view->priv->arrow_prelit)
@ -9853,7 +9853,7 @@ _gtk_tree_view_column_start_drag (GtkTreeView *tree_view,
send_event->button.y = -1; send_event->button.y = -1;
send_event->button.axes = NULL; send_event->button.axes = NULL;
send_event->button.state = 0; send_event->button.state = 0;
send_event->button.button = 1; send_event->button.button = GDK_BUTTON_PRIMARY;
send_event->button.x_root = 0; send_event->button.x_root = 0;
send_event->button.y_root = 0; send_event->button.y_root = 0;
gdk_event_set_device (send_event, device); gdk_event_set_device (send_event, device);