elm.hoversel: fix item size calculation
authorJee-Yong Um <jc9.um@samsung.com>
Fri, 16 Dec 2016 23:02:06 +0000 (15:02 -0800)
committerCedric BAIL <cedric@osg.samsung.com>
Fri, 16 Dec 2016 23:02:09 +0000 (15:02 -0800)
Summary:
The way to find the position of hoversel expansion is based on geometry
currently, but it causes errors when theme is not made as expected.
This patch makes hoversel use string to find the right position and
calculate item width correctly when items are shorter than hoversel itself.

Test Plan:
elementary_test -to hoversel
(error case shows in tizen mobile device when screen is rotated)

Reviewers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4484

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/lib/elementary/elc_hoversel.c

index 22331b4ebe5b1a5b9f9601131f5745111927bf0c..745e7ff1071d21b0d23ecfea6915d6e343a21621 100644 (file)
@@ -282,7 +282,7 @@ _resizing_eval(Evas_Object *obj, Elm_Hoversel_Data *sd)
 
    if (sd->horizontal)
      {
-        if (xx < obj_x)
+        if (!strcmp(sd->last_location, "left"))
           {
              xx = x;
              if ((xx + ww) > obj_x)
@@ -300,7 +300,7 @@ _resizing_eval(Evas_Object *obj, Elm_Hoversel_Data *sd)
      }
    else
      {
-        if (yy < obj_y)
+        if (!strcmp(sd->last_location, "top"))
           {
              yy = y;
              if ((yy + hh) > obj_y)
@@ -328,6 +328,7 @@ _resizing_eval(Evas_Object *obj, Elm_Hoversel_Data *sd)
                }
           }
      }
+   if (ww < obj_w) ww = obj_w;
    evas_object_size_hint_min_set(sd->spacer, ww, hh);
 }