summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2015-12-20 10:49:22 +0100
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2015-12-20 10:49:22 +0100
commit54b2f4460e2eeadb8a120f8085b95f0b2bfa75dc (patch)
tree13963c7d9bcf6df1b5850b597c478a21afd9b661
parent54e67709f87448c41a5fde61a8481359d4a0a8e0 (diff)
views: remove keybindings which are implemented in elmkey_binding_fix
-rw-r--r--data/theme/elm_ext/file_icon.edc15
-rw-r--r--src/widgets/file/views/elm_file_display_view_grid.c103
-rw-r--r--src/widgets/file/views/elm_file_display_view_list.c91
3 files changed, 3 insertions, 206 deletions
diff --git a/data/theme/elm_ext/file_icon.edc b/data/theme/elm_ext/file_icon.edc
index 984fa74..533210a 100644
--- a/data/theme/elm_ext/file_icon.edc
+++ b/data/theme/elm_ext/file_icon.edc
@@ -53,20 +53,5 @@ group { name: "elm/file_icon/base/default";
53 fixed: 1 1; 53 fixed: 1 1;
54 } 54 }
55 } 55 }
56 part { name: "drop_indicator";
57 description { state: "default" 0.0;
58 rel1.to: "content";
59 rel2.to: "text";
60 image {
61 normal: "outline_glow.png";
62 border: 2 2 2 2;
63 }
64 visible: 0;
65 }
66 description { state: "drop" 0.0;
67 inherit: "default";
68 visible: 1;
69 }
70 }
71 } 56 }
72 } \ No newline at end of file 57 } \ No newline at end of file
diff --git a/src/widgets/file/views/elm_file_display_view_grid.c b/src/widgets/file/views/elm_file_display_view_grid.c
index fb18ea0..2d59ccd 100644
--- a/src/widgets/file/views/elm_file_display_view_grid.c
+++ b/src/widgets/file/views/elm_file_display_view_grid.c
@@ -236,78 +236,8 @@ _key_down(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description2 *desc EIN
236 const Eina_List *selected; 236 const Eina_List *selected;
237 Eo *grid = data; 237 Eo *grid = data;
238 Elm_Object_Item *mover; 238 Elm_Object_Item *mover;
239 Elm_Object_Item *next;
240 Evas_Object *track;
241 int x,y,w,h;
242 239
243 if (!strcmp(ev->key, "Right")) 240 if (!strcmp(ev->key, "Return"))
244 {
245 if (!empty_check(grid))
246 return EO_CALLBACK_STOP;
247
248 selected = elm_gengrid_selected_items_get(grid);
249 mover = eina_list_data_get(eina_list_last(selected));
250
251 next = elm_gengrid_item_next_get(mover);
252
253 _item_select_swap(grid, selected, next);
254 return EO_CALLBACK_STOP;
255 }
256 else if (!strcmp(ev->key, "Left"))
257 {
258 if (!empty_check(grid))
259 return EO_CALLBACK_STOP;
260
261 selected = elm_gengrid_selected_items_get(grid);
262 mover = eina_list_data_get(eina_list_last(selected));
263
264 next = elm_gengrid_item_prev_get(mover);
265
266 _item_select_swap(grid, selected, next);
267
268 return EO_CALLBACK_STOP;
269 }
270 else if (!strcmp(ev->key, "Up"))
271 {
272 if (!empty_check(grid))
273 return EO_CALLBACK_STOP;
274
275 selected = elm_gengrid_selected_items_get(grid);
276 mover = eina_list_data_get((selected));
277 track = elm_object_item_track(mover);
278
279 evas_object_geometry_get(track, &x, &y, &w, &h);
280
281 y -= w/2;
282 x += w/2;
283
284 next = elm_gengrid_at_xy_item_get(grid, x, y, NULL, NULL);
285
286 _item_select_swap(grid, eina_list_clone(selected), next);
287
288 return EO_CALLBACK_STOP;
289 }
290 else if (!strcmp(ev->key, "Down"))
291 {
292 if (!empty_check(grid))
293 return EO_CALLBACK_STOP;
294
295 selected = elm_gengrid_selected_items_get(grid);
296 mover = eina_list_data_get(eina_list_last(selected));
297 track = elm_object_item_track(mover);
298
299 evas_object_geometry_get(track, &x, &y, &w, &h);
300
301 y += w+w/2;
302 x += w/2;
303
304 next = elm_gengrid_at_xy_item_get(grid, x, y, NULL, NULL);
305
306 _item_select_swap(grid, eina_list_clone(selected), next);
307
308 return EO_CALLBACK_STOP;
309 }
310 else if (!strcmp(ev->key, "Return"))
311 { 241 {
312 Efm_File *fmm_file; 242 Efm_File *fmm_file;
313 selected = elm_gengrid_selected_items_get(grid); 243 selected = elm_gengrid_selected_items_get(grid);
@@ -322,36 +252,6 @@ _key_down(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description2 *desc EIN
322 252
323 return EO_CALLBACK_STOP; 253 return EO_CALLBACK_STOP;
324 } 254 }
325 else if (!strcmp(ev->key, "Home"))
326 {
327 // first item
328 eo_do(grid, elm_interface_scrollable_page_bring_in(0, 0));
329 return EO_CALLBACK_STOP;
330 }
331 else if (!strcmp(ev->key, "End"))
332 {
333 // last item
334 int h,v;
335 eo_do(grid, elm_interface_scrollable_last_page_get(&h, &v);
336 elm_interface_scrollable_page_bring_in(h, v));
337 return EO_CALLBACK_STOP;
338 }
339 else if (!strcmp(ev->key, "Next"))
340 {
341 // next page
342 int h,v;
343 eo_do(grid, elm_interface_scrollable_current_page_get(&h, &v);
344 elm_interface_scrollable_page_bring_in(h, v+1));
345 return EO_CALLBACK_STOP;
346 }
347 else if (!strcmp(ev->key, "Prior"))
348 {
349 // prior page
350 int h,v;
351 eo_do(grid, elm_interface_scrollable_current_page_get(&h, &v);
352 elm_interface_scrollable_page_bring_in(h, v-1));
353 return EO_CALLBACK_STOP;
354 }
355 255
356 return EO_CALLBACK_CONTINUE; 256 return EO_CALLBACK_CONTINUE;
357} 257}
@@ -368,7 +268,6 @@ _elm_file_display_view_grid_eo_base_constructor(Eo *obj, Elm_File_Display_View_G
368 268
369 eo_do_super(obj, ELM_FILE_DISPLAY_VIEW_GRID_CLASS, eo = eo_constructor()); 269 eo_do_super(obj, ELM_FILE_DISPLAY_VIEW_GRID_CLASS, eo = eo_constructor());
370 270
371 eo_do(obj, elm_interface_scrollable_page_relative_set(1.0, 0.9));
372 elm_gengrid_align_set(obj, 0.5, 0.0); 271 elm_gengrid_align_set(obj, 0.5, 0.0);
373 eo_do(obj, parent = eo_parent_get()); 272 eo_do(obj, parent = eo_parent_get());
374 273
diff --git a/src/widgets/file/views/elm_file_display_view_list.c b/src/widgets/file/views/elm_file_display_view_list.c
index 4617041..81b2ea8 100644
--- a/src/widgets/file/views/elm_file_display_view_list.c
+++ b/src/widgets/file/views/elm_file_display_view_list.c
@@ -235,67 +235,11 @@ static Eina_Bool
235_key_down(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description2 *desc EINA_UNUSED, void *event) 235_key_down(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description2 *desc EINA_UNUSED, void *event)
236{ 236{
237 Evas_Event_Key_Down *ev = event; 237 Evas_Event_Key_Down *ev = event;
238 const Eina_List *selected, *node; 238 const Eina_List *selected;
239 Eo *list = data; 239 Eo *list = data;
240 Elm_Object_Item *mover; 240 Elm_Object_Item *mover;
241 Elm_Object_Item *next;
242 Elm_Object_Item *sel;
243 Evas_Object *track;
244 int x,y,w,h;
245
246 selected = elm_genlist_selected_items_get(list);
247 EINA_LIST_FOREACH(selected, node, sel)
248 {
249 Evas_Object *icon;
250 Eina_Bool rename;
251
252 icon = elm_object_item_part_content_get(sel, "elm.swallow.icon");
253 eo_do(icon, rename = elm_obj_file_icon_rename_get());
254 if (rename)
255 return EO_CALLBACK_CONTINUE;
256 }
257
258 if (!strcmp(ev->key, "Up"))
259 {
260 if (!empty_check(list))
261 return EO_CALLBACK_STOP;
262
263 selected = elm_genlist_selected_items_get(list);
264 mover = eina_list_data_get((selected));
265 track = elm_object_item_track(mover);
266
267 evas_object_geometry_get(track, &x, &y, &w, &h);
268
269 y -= w/2;
270 x += w/2;
271
272 next = elm_genlist_at_xy_item_get(list, x, y, NULL);
273
274 _item_select_swap(list, eina_list_clone(selected), next);
275
276 return EO_CALLBACK_STOP;
277 }
278 else if (!strcmp(ev->key, "Down"))
279 {
280 if (!empty_check(list))
281 return EO_CALLBACK_STOP;
282
283 selected = elm_genlist_selected_items_get(list);
284 mover = eina_list_data_get(eina_list_last(selected));
285 track = elm_object_item_track(mover);
286
287 evas_object_geometry_get(track, &x, &y, &w, &h);
288
289 y += w+w/2;
290 x += w/2;
291
292 next = elm_genlist_at_xy_item_get(list, x, y, NULL);
293 241
294 _item_select_swap(list, eina_list_clone(selected), next); 242 if (!strcmp(ev->key, "Return"))
295
296 return EO_CALLBACK_STOP;
297 }
298 else if (!strcmp(ev->key, "Return"))
299 { 243 {
300 Efm_File *fmm_file; 244 Efm_File *fmm_file;
301 selected = elm_genlist_selected_items_get(list); 245 selected = elm_genlist_selected_items_get(list);
@@ -310,36 +254,6 @@ _key_down(void *data, Eo *obj EINA_UNUSED, const Eo_Event_Description2 *desc EIN
310 254
311 return EO_CALLBACK_STOP; 255 return EO_CALLBACK_STOP;
312 } 256 }
313 else if (!strcmp(ev->key, "Home"))
314 {
315 // first item
316 eo_do(list, elm_interface_scrollable_page_bring_in(0, 0));
317 return EO_CALLBACK_STOP;
318 }
319 else if (!strcmp(ev->key, "End"))
320 {
321 // last item
322 int h,v;
323 eo_do(list, elm_interface_scrollable_last_page_get(&h, &v);
324 elm_interface_scrollable_page_bring_in(h, v));
325 return EO_CALLBACK_STOP;
326 }
327 else if (!strcmp(ev->key, "Next"))
328 {
329 // next page
330 int h,v;
331 eo_do(list, elm_interface_scrollable_current_page_get(&h, &v);
332 elm_interface_scrollable_page_bring_in(h, v+1));
333 return EO_CALLBACK_STOP;
334 }
335 else if (!strcmp(ev->key, "Prior"))
336 {
337 // prior page
338 int h,v;
339 eo_do(list, elm_interface_scrollable_current_page_get(&h, &v);
340 elm_interface_scrollable_page_bring_in(h, v-1));
341 return EO_CALLBACK_STOP;
342 }
343 257
344 return EO_CALLBACK_CONTINUE; 258 return EO_CALLBACK_CONTINUE;
345} 259}
@@ -357,7 +271,6 @@ _elm_file_display_view_list_eo_base_constructor(Eo *obj, Elm_File_Display_View_L
357 eo_do_super(obj, ELM_FILE_DISPLAY_VIEW_LIST_CLASS, eo = eo_constructor()); 271 eo_do_super(obj, ELM_FILE_DISPLAY_VIEW_LIST_CLASS, eo = eo_constructor());
358 elm_genlist_homogeneous_set(obj, EINA_TRUE); 272 elm_genlist_homogeneous_set(obj, EINA_TRUE);
359 273
360 eo_do(obj, elm_interface_scrollable_page_relative_set(1.0, 0.9));
361 eo_do(obj, parent = eo_parent_get()); 274 eo_do(obj, parent = eo_parent_get());
362 275
363 eo_do(parent, eo_event_callback_add(EVAS_OBJECT_EVENT_KEY_DOWN, _key_down, obj)); 276 eo_do(parent, eo_event_callback_add(EVAS_OBJECT_EVENT_KEY_DOWN, _key_down, obj));