Mercurial > geeqie
comparison src/collect-table.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 |
comparison
equal
deleted
inserted
replaced
447:d87de3a3eb3b | 448:a73cc0fa14d0 |
---|---|
1425 ct->click_info = info; | 1425 ct->click_info = info; |
1426 collection_table_selection_add(ct, ct->click_info, SELECTION_PRELIGHT, &iter); | 1426 collection_table_selection_add(ct, ct->click_info, SELECTION_PRELIGHT, &iter); |
1427 | 1427 |
1428 switch (bevent->button) | 1428 switch (bevent->button) |
1429 { | 1429 { |
1430 case 1: | 1430 case MOUSE_BUTTON_LEFT: |
1431 if (bevent->type == GDK_2BUTTON_PRESS) | 1431 if (bevent->type == GDK_2BUTTON_PRESS) |
1432 { | 1432 { |
1433 if (info) | 1433 if (info) |
1434 { | 1434 { |
1435 layout_image_set_collection(NULL, ct->cd, info); | 1435 layout_image_set_collection(NULL, ct->cd, info); |
1438 else if (!GTK_WIDGET_HAS_FOCUS(ct->listview)) | 1438 else if (!GTK_WIDGET_HAS_FOCUS(ct->listview)) |
1439 { | 1439 { |
1440 gtk_widget_grab_focus(ct->listview); | 1440 gtk_widget_grab_focus(ct->listview); |
1441 } | 1441 } |
1442 break; | 1442 break; |
1443 case 3: | 1443 case MOUSE_BUTTON_RIGHT: |
1444 ct->popup = collection_table_popup_menu(ct, (info != NULL)); | 1444 ct->popup = collection_table_popup_menu(ct, (info != NULL)); |
1445 gtk_menu_popup(GTK_MENU(ct->popup), NULL, NULL, NULL, NULL, bevent->button, bevent->time); | 1445 gtk_menu_popup(GTK_MENU(ct->popup), NULL, NULL, NULL, NULL, bevent->button, bevent->time); |
1446 break; | 1446 break; |
1447 default: | 1447 default: |
1448 break; | 1448 break; |
1467 if (ct->click_info) | 1467 if (ct->click_info) |
1468 { | 1468 { |
1469 collection_table_selection_remove(ct, ct->click_info, SELECTION_PRELIGHT, NULL); | 1469 collection_table_selection_remove(ct, ct->click_info, SELECTION_PRELIGHT, NULL); |
1470 } | 1470 } |
1471 | 1471 |
1472 if (bevent->button == 1 && | 1472 if (bevent->button == MOUSE_BUTTON_LEFT && |
1473 info && ct->click_info == info) | 1473 info && ct->click_info == info) |
1474 { | 1474 { |
1475 collection_table_set_focus(ct, info); | 1475 collection_table_set_focus(ct, info); |
1476 | 1476 |
1477 if (bevent->state & GDK_CONTROL_MASK) | 1477 if (bevent->state & GDK_CONTROL_MASK) |
1501 { | 1501 { |
1502 collection_table_select_util(ct, info, TRUE); | 1502 collection_table_select_util(ct, info, TRUE); |
1503 } | 1503 } |
1504 } | 1504 } |
1505 } | 1505 } |
1506 else if (bevent->button == 2 && | 1506 else if (bevent->button == MOUSE_BUTTON_MIDDLE && |
1507 info && ct->click_info == info) | 1507 info && ct->click_info == info) |
1508 { | 1508 { |
1509 collection_table_select_util(ct, info, !INFO_SELECTED(info)); | 1509 collection_table_select_util(ct, info, !INFO_SELECTED(info)); |
1510 } | 1510 } |
1511 | 1511 |