summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2013-04-17 16:08:29 +0900
committerJaehwan Kim <jae.hwan.kim@samsung.com>2014-02-07 15:17:38 +0900
commit235f156b4ce776ad51374d33b81372683209c875 (patch)
treef5f95b19a54d551e33701adb2860a4655f43f9ca
parentb642746c8ce62439ac69e2e92e7913ec35180e65 (diff)
[access][layout] sort focus list based on geometry value
Conflicts: src/lib/elm_layout.c
-rw-r--r--src/lib/elm_layout.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/lib/elm_layout.c b/src/lib/elm_layout.c
index 4fa8724de..7aa68f3bf 100644
--- a/src/lib/elm_layout.c
+++ b/src/lib/elm_layout.c
@@ -424,6 +424,39 @@ _elm_layout_smart_focus_next_manager_is(Eo *obj EINA_UNUSED, void *_pd EINA_UNUS
424 else 424 else
425 *ret = EINA_FALSE; 425 *ret = EINA_FALSE;
426} 426}
427
428static int
429_access_focus_list_sort_cb(const void *data1, const void *data2)
430{
431 Evas_Coord_Point p1, p2;
432 Evas_Object *obj1, *obj2;
433
434 obj1 = ((Elm_Layout_Sub_Object_Data *)data1)->obj;
435 obj2 = ((Elm_Layout_Sub_Object_Data *)data2)->obj;
436
437 evas_object_geometry_get(obj1, &p1.x, &p1.y, NULL, NULL);
438 evas_object_geometry_get(obj2, &p2.x, &p2.y, NULL, NULL);
439
440 if (p1.y == p2.y)
441 {
442 return p1.x - p2.x;
443 }
444
445 return p1.y - p2.y;
446}
447
448static const Eina_List *
449_access_focus_list_sort(Eina_List *origin)
450{
451 Eina_List *l, *temp = NULL;
452 Elm_Layout_Sub_Object_Data *sub_d;
453
454 EINA_LIST_FOREACH(origin, l, sub_d)
455 temp = eina_list_sorted_insert(temp, _access_focus_list_sort_cb, sub_d);
456
457 return temp;
458}
459
427/* WARNING: if you're making a widget *not* supposed to have focusable 460/* WARNING: if you're making a widget *not* supposed to have focusable
428 * child objects, but still inheriting from elm_layout, just set its 461 * child objects, but still inheriting from elm_layout, just set its
429 * focus_next smart function back to NULL */ 462 * focus_next smart function back to NULL */
@@ -449,6 +482,9 @@ _elm_layout_smart_focus_next(Eo *obj, void *_pd, va_list *list)
449 list_data_get = _elm_layout_list_data_get; 482 list_data_get = _elm_layout_list_data_get;
450 483
451 if (!items) return; 484 if (!items) return;
485
486 if (_elm_config->access_mode)
487 items = _access_focus_list_sort((Eina_List *)items);
452 } 488 }
453 489
454 int_ret = elm_widget_focus_list_next_get 490 int_ret = elm_widget_focus_list_next_get