elm.hoversel: revert unnecessary item expansion & get proper size
authorJee-Yong Um <jc9.um@samsung.com>
Fri, 13 Jan 2017 00:32:02 +0000 (16:32 -0800)
committerCedric BAIL <cedric@osg.samsung.com>
Fri, 13 Jan 2017 00:32:05 +0000 (16:32 -0800)
Summary:
The changes of previous patch (4ea7effe70423b5f88f98aea45a96582669aa280)
are reverted, and item calculation is fixed correctly.
The main reason why hoversel item has wrong size in screen rotation is
that hover doesn't update geometry when the size of target object is changed.

Test Plan: elementary_test -to hoversel

Reviewers: cedric, jpeg

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

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

index e95ddc6..0ecf69c 100644 (file)
@@ -331,7 +331,6 @@ _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);
 }
 
index 3f306ff..f39711f 100644 (file)
@@ -699,6 +699,8 @@ _elm_hover_target_set(Eo *obj, Elm_Hover_Data *sd, Evas_Object *target)
           (sd->target, EVAS_CALLBACK_DEL, _target_del_cb, obj);
         evas_object_event_callback_del_full
           (sd->target, EVAS_CALLBACK_MOVE, _target_move_cb, obj);
+        evas_object_event_callback_del_full
+          (sd->target, EVAS_CALLBACK_RESIZE, _target_move_cb, obj);
         elm_widget_hover_object_set(sd->target, NULL);
      }
 
@@ -709,6 +711,8 @@ _elm_hover_target_set(Eo *obj, Elm_Hover_Data *sd, Evas_Object *target)
           (sd->target, EVAS_CALLBACK_DEL, _target_del_cb, obj);
         evas_object_event_callback_add
           (sd->target, EVAS_CALLBACK_MOVE, _target_move_cb, obj);
+        evas_object_event_callback_add
+          (sd->target, EVAS_CALLBACK_RESIZE, _target_move_cb, obj);
         elm_widget_hover_object_set(target, obj);
         elm_layout_sizing_eval(obj);
      }