From b52366b70dd37cd6a70b61fdb787c4bb276429d0 Mon Sep 17 00:00:00 2001 From: Kim Shinwoo Date: Fri, 28 Sep 2012 08:48:48 +0000 Subject: [PATCH] From: Kim Shinwoo Subject: [E-devel] [patch][elementary] diskselector - checking middle item the diskselector object x-coordinate would not be 0. but the _scroll_animate_stop_cb() calculates selected item with assumption that the diskselector object x-coordinate is 0. so different item which is not in middle of diskselector is selected. SVN revision: 77182 --- legacy/elementary/ChangeLog | 5 +++++ legacy/elementary/NEWS | 1 + legacy/elementary/src/lib/elm_diskselector.c | 6 +++--- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/legacy/elementary/ChangeLog b/legacy/elementary/ChangeLog index 7307efcb33..cd37954196 100644 --- a/legacy/elementary/ChangeLog +++ b/legacy/elementary/ChangeLog @@ -542,3 +542,8 @@ 2012-09-27 Jaehwan Kim * Add the toolbar API which expand the transverse length + +2012-09-28 Shinwoo Kim (kimcinoo) + + * Fix disk selector selection of middle item when obj not at 0. + diff --git a/legacy/elementary/NEWS b/legacy/elementary/NEWS index 0d200585dc..bf3aa7f011 100644 --- a/legacy/elementary/NEWS +++ b/legacy/elementary/NEWS @@ -31,6 +31,7 @@ Fixes: * Fix diskselector when bounce off and round enabled. * Fix bubble info field set. * Escape theme filename correctly. + * Fix diskselkector selection of middle item. Removals: diff --git a/legacy/elementary/src/lib/elm_diskselector.c b/legacy/elementary/src/lib/elm_diskselector.c index 39c666468a..a769a07468 100644 --- a/legacy/elementary/src/lib/elm_diskselector.c +++ b/legacy/elementary/src/lib/elm_diskselector.c @@ -903,7 +903,7 @@ _scroll_animate_stop_cb(Evas_Object *obj, void *data __UNUSED__) { Elm_Diskselector_Item *it; - Evas_Coord x, w, ow; + Evas_Coord x, w, ox, ow; Eina_List *l, *list; ELM_DISKSELECTOR_DATA_GET(obj, sd); @@ -915,11 +915,11 @@ _scroll_animate_stop_cb(Evas_Object *obj, else list = sd->r_items; - evas_object_geometry_get(obj, NULL, NULL, &ow, NULL); + evas_object_geometry_get(obj, &ox, NULL, &ow, NULL); EINA_LIST_FOREACH (list, l, it) { evas_object_geometry_get(VIEW(it), &x, NULL, &w, NULL); - if (abs((int)(ow / 2 - (int)(x + w / 2))) < 10) break; + if (abs((int)(ox + (ow / 2)) - (int)(x + (w / 2))) < 10) break; } if (!it) return;