diff options
author | Minkyu Kang <mk7.kang@samsung.com> | 2017-02-21 15:02:30 +0530 |
---|---|---|
committer | Amitesh Singh <amitesh.sh@samsung.com> | 2017-02-21 15:18:11 +0530 |
commit | e62d78d594cb8b670bff722193dfa3d1b4baa5a5 (patch) | |
tree | 65443485a3da6e3e9291c85f61c60c10734bc43d /src/lib | |
parent | 629acbc545ce65c5710f095715bd3a6c6298b781 (diff) |
elementary gengrid: fix for working item reorder mode correctly
Summary:
Change the item indexing to start 1 after reordering animation.
Change the logic of edge checking to get the row or col correctly.
Signed-off-by: Minkyu Kang <mk7.kang@samsung.com>
Test Plan:
elementary_test -to gengrid2
append 6 items
enable the reorder mode
check reordering is working properly (4 to 1)
@fix
Reviewers: singh.amitesh, cedric
Subscribers: jehun.lim, jpeg
Differential Revision: https://phab.enlightenment.org/D4676
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/elementary/elm_gengrid.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c index f677857eb3..3be1fee00a 100644 --- a/src/lib/elementary/elm_gengrid.c +++ b/src/lib/elementary/elm_gengrid.c | |||
@@ -2770,25 +2770,22 @@ _elm_gengrid_item_edge_check(Elm_Object_Item *eo_it, | |||
2770 | ((sd->horizontal) && (dir == ELM_FOCUS_LEFT))) | 2770 | ((sd->horizontal) && (dir == ELM_FOCUS_LEFT))) |
2771 | { | 2771 | { |
2772 | Evas_Coord col, row, cvw, cvh; | 2772 | Evas_Coord col, row, cvw, cvh; |
2773 | int x; | ||
2774 | 2773 | ||
2775 | evas_object_geometry_get(sd->pan_obj, NULL, NULL, &cvw, &cvh); | 2774 | evas_object_geometry_get(sd->pan_obj, NULL, NULL, &cvw, &cvh); |
2776 | if (sd->horizontal && sd->item_height > 0) | 2775 | if (sd->horizontal && sd->item_height > 0) |
2777 | { | 2776 | { |
2778 | row = cvh / sd->item_height; | 2777 | row = cvh / sd->item_height; |
2779 | if (row <= 0) row = 1; | 2778 | if (row <= 0) row = 1; |
2780 | col = tmp->position / row; | 2779 | col = (tmp->position - 1) / row; |
2781 | x = tmp->position % row; | 2780 | if (col == 0) |
2782 | if (col == 0 || (col == 1 && x == 0)) | ||
2783 | return EINA_TRUE; | 2781 | return EINA_TRUE; |
2784 | } | 2782 | } |
2785 | else if (sd->item_width > 0) | 2783 | else if (sd->item_width > 0) |
2786 | { | 2784 | { |
2787 | col = cvw / sd->item_width; | 2785 | col = cvw / sd->item_width; |
2788 | if (col <= 0) col = 1; | 2786 | if (col <= 0) col = 1; |
2789 | row = tmp->position / col; | 2787 | row = (tmp->position - 1) / col; |
2790 | x = tmp->position % col; | 2788 | if (row == 0) |
2791 | if (row == 0 || (row == 1 && x == 0)) | ||
2792 | return EINA_TRUE; | 2789 | return EINA_TRUE; |
2793 | } | 2790 | } |
2794 | } | 2791 | } |
@@ -3025,7 +3022,7 @@ _anim_end(Elm_Gengrid_Data *sd) | |||
3025 | EINA_INLIST_GET(sd->reorder.it2)); | 3022 | EINA_INLIST_GET(sd->reorder.it2)); |
3026 | } | 3023 | } |
3027 | } | 3024 | } |
3028 | _item_position_update(sd->items, 0); | 3025 | _item_position_update(sd->items, 1); |
3029 | 3026 | ||
3030 | ecore_job_del(sd->calc_job); | 3027 | ecore_job_del(sd->calc_job); |
3031 | sd->calc_job = ecore_job_add(_calc_job, sd->obj); | 3028 | sd->calc_job = ecore_job_add(_calc_job, sd->obj); |