Mercurial > geeqie
comparison src/collect-table.c @ 85:9d5c75b5ec28
Fri Oct 20 09:20:10 2006 John Ellis <johne@verizon.net>
* collect-table.c, collect.c, dupe.c, pan-view.c, search.c,
view_file_icon.c: Keypress signal handler code clean-up round 2: the
remaining files. Make control and shift logic easier to follow.
author | gqview |
---|---|
date | Fri, 20 Oct 2006 13:25:03 +0000 |
parents | 04ff0df3ad2f |
children | 71e1ebee420e |
comparison
equal
deleted
inserted
replaced
84:ba3c39002a24 | 85:9d5c75b5ec28 |
---|---|
1022 } | 1022 } |
1023 | 1023 |
1024 static gint collection_table_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) | 1024 static gint collection_table_press_key_cb(GtkWidget *widget, GdkEventKey *event, gpointer data) |
1025 { | 1025 { |
1026 CollectTable *ct = data; | 1026 CollectTable *ct = data; |
1027 gint stop_signal = FALSE; | |
1028 gint focus_row = 0; | 1027 gint focus_row = 0; |
1029 gint focus_col = 0; | 1028 gint focus_col = 0; |
1030 CollectInfo *info; | 1029 CollectInfo *info; |
1031 | 1030 gint stop_signal; |
1031 | |
1032 stop_signal = TRUE; | |
1032 switch (event->keyval) | 1033 switch (event->keyval) |
1033 { | 1034 { |
1034 case GDK_Left: case GDK_KP_Left: | 1035 case GDK_Left: case GDK_KP_Left: |
1035 focus_col = -1; | 1036 focus_col = -1; |
1036 stop_signal = TRUE; | |
1037 break; | 1037 break; |
1038 case GDK_Right: case GDK_KP_Right: | 1038 case GDK_Right: case GDK_KP_Right: |
1039 focus_col = 1; | 1039 focus_col = 1; |
1040 stop_signal = TRUE; | |
1041 break; | 1040 break; |
1042 case GDK_Up: case GDK_KP_Up: | 1041 case GDK_Up: case GDK_KP_Up: |
1043 focus_row = -1; | 1042 focus_row = -1; |
1044 stop_signal = TRUE; | |
1045 break; | 1043 break; |
1046 case GDK_Down: case GDK_KP_Down: | 1044 case GDK_Down: case GDK_KP_Down: |
1047 focus_row = 1; | 1045 focus_row = 1; |
1048 stop_signal = TRUE; | |
1049 break; | 1046 break; |
1050 case GDK_Page_Up: case GDK_KP_Page_Up: | 1047 case GDK_Page_Up: case GDK_KP_Page_Up: |
1051 focus_row = -page_height(ct); | 1048 focus_row = -page_height(ct); |
1052 stop_signal = TRUE; | |
1053 break; | 1049 break; |
1054 case GDK_Page_Down: case GDK_KP_Page_Down: | 1050 case GDK_Page_Down: case GDK_KP_Page_Down: |
1055 focus_row = page_height(ct); | 1051 focus_row = page_height(ct); |
1056 stop_signal = TRUE; | |
1057 break; | 1052 break; |
1058 case GDK_Home: case GDK_KP_Home: | 1053 case GDK_Home: case GDK_KP_Home: |
1059 focus_row = -ct->focus_row; | 1054 focus_row = -ct->focus_row; |
1060 focus_col = -ct->focus_column; | 1055 focus_col = -ct->focus_column; |
1061 stop_signal = TRUE; | |
1062 break; | 1056 break; |
1063 case GDK_End: case GDK_KP_End: | 1057 case GDK_End: case GDK_KP_End: |
1064 focus_row = ct->rows - 1 - ct->focus_row; | 1058 focus_row = ct->rows - 1 - ct->focus_row; |
1065 focus_col = ct->columns - 1 - ct->focus_column; | 1059 focus_col = ct->columns - 1 - ct->focus_column; |
1066 stop_signal = TRUE; | |
1067 break; | 1060 break; |
1068 case GDK_space: | 1061 case GDK_space: |
1069 info = collection_table_find_data(ct, ct->focus_row, ct->focus_column, NULL); | 1062 info = collection_table_find_data(ct, ct->focus_row, ct->focus_column, NULL); |
1070 if (info) | 1063 if (info) |
1071 { | 1064 { |
1078 { | 1071 { |
1079 collection_table_unselect_all(ct); | 1072 collection_table_unselect_all(ct); |
1080 collection_table_select(ct, info); | 1073 collection_table_select(ct, info); |
1081 } | 1074 } |
1082 } | 1075 } |
1083 stop_signal = TRUE; | |
1084 break; | 1076 break; |
1085 case 'T': case 't': | 1077 case 'T': case 't': |
1086 if (event->state & GDK_CONTROL_MASK) collection_table_toggle_filenames(ct); | 1078 if (event->state & GDK_CONTROL_MASK) collection_table_toggle_filenames(ct); |
1087 break; | 1079 break; |
1088 case GDK_Menu: | 1080 case GDK_Menu: |
1093 collection_table_selection_add(ct, ct->click_info, SELECTION_PRELIGHT, NULL); | 1085 collection_table_selection_add(ct, ct->click_info, SELECTION_PRELIGHT, NULL); |
1094 tip_unschedule(ct); | 1086 tip_unschedule(ct); |
1095 | 1087 |
1096 ct->popup = collection_table_popup_menu(ct, (info != NULL)); | 1088 ct->popup = collection_table_popup_menu(ct, (info != NULL)); |
1097 gtk_menu_popup(GTK_MENU(ct->popup), NULL, NULL, collection_table_menu_pos_cb, ct, 0, GDK_CURRENT_TIME); | 1089 gtk_menu_popup(GTK_MENU(ct->popup), NULL, NULL, collection_table_menu_pos_cb, ct, 0, GDK_CURRENT_TIME); |
1098 stop_signal = TRUE; | |
1099 break; | 1090 break; |
1100 default: | 1091 default: |
1092 stop_signal = FALSE; | |
1101 break; | 1093 break; |
1102 } | 1094 } |
1103 | 1095 |
1104 if (focus_row != 0 || focus_col != 0) | 1096 if (focus_row != 0 || focus_col != 0) |
1105 { | 1097 { |
1137 } | 1129 } |
1138 } | 1130 } |
1139 | 1131 |
1140 if (stop_signal) | 1132 if (stop_signal) |
1141 { | 1133 { |
1134 #if 0 | |
1142 g_signal_stop_emission_by_name(GTK_OBJECT(widget), "key_press_event"); | 1135 g_signal_stop_emission_by_name(GTK_OBJECT(widget), "key_press_event"); |
1136 #endif | |
1143 tip_unschedule(ct); | 1137 tip_unschedule(ct); |
1144 } | 1138 } |
1145 | 1139 |
1146 return stop_signal; | 1140 return stop_signal; |
1147 } | 1141 } |