toolbar: fix item resize issue.
authorBowon Ryu <bowon.ryu@samsung.com>
Fri, 4 Nov 2016 02:43:17 +0000 (11:43 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Tue, 8 Nov 2016 01:46:30 +0000 (10:46 +0900)
Change-Id: I62f2bc80cd5e33aea1111cb741bad5bc13b9ca13
Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
src/lib/elm_toolbar.c
src/lib/elm_toolbar.eo

index 4e27fc5..b5cb4d9 100644 (file)
@@ -1666,6 +1666,38 @@ _elm_toolbar_elm_widget_theme_apply(Eo *obj, Elm_Toolbar_Data *sd)
    return int_ret;
 }
 
+// TIZEN_ONLY(20150625): fix item resize issue.
+EOLIAN static void
+_elm_toolbar_elm_widget_orientation_set(Eo *obj, Elm_Toolbar_Data *sd, int orient_mode)
+{
+   Elm_Toolbar_Item_Data *it;
+
+   if (orient_mode != -1)
+     {
+        char buf[128];
+        Evas_Coord mw, mh;
+
+        snprintf(buf, sizeof(buf), "elm,state,orient,%d", orient_mode);
+        EINA_INLIST_FOREACH(sd->items, it)
+          {
+             eo_do(elm_layout_edje_get(VIEW(it)),
+                   edje_obj_signal_emit(buf, "elm"),
+                   edje_obj_message_signal_process(),
+                   edje_obj_size_min_restricted_calc(&mw, &mh, -1, -1));
+
+             if (!it->separator && !it->object)
+               elm_coords_finger_size_adjust(1, &mw, 1, &mh);
+
+             eo_do(VIEW(it),
+                   evas_obj_size_hint_min_set(mw, mh),
+                   evas_obj_size_hint_max_set(-1, -1));
+          }
+     }
+
+   eo_do_super(obj, MY_CLASS, elm_obj_widget_orientation_set(orient_mode));
+}
+//
+
 static void
 _elm_toolbar_item_label_update(Elm_Toolbar_Item_Data *item)
 {
@@ -3038,6 +3070,13 @@ _elm_toolbar_evas_object_smart_resize(Eo *obj, Elm_Toolbar_Data *sd, Evas_Coord
    eo_do_super(obj, MY_CLASS, evas_obj_smart_resize(w, h));
 
    evas_object_resize(sd->hit_rect, w, h);
+   // TIZEN_ONLY(20150625): fix item resize issue.
+   /*resize the box first to avoid flickering of
+     saved state of the toolbar when ratation changed but not in case of scroll*/
+   if (sd->shrink_mode != ELM_TOOLBAR_SHRINK_SCROLL)
+     evas_object_resize(sd->bx, w, h);
+   _resizing_eval(obj);
+   //
 }
 
 EOLIAN static void
index 15fa45c..cb82bbb 100644 (file)
@@ -536,6 +536,9 @@ class Elm.Toolbar (Elm.Widget, Elm_Interface_Scrollable,
       Elm.Widget.event;
       Elm.Widget.focus_highlight_geometry_get;
       Elm.Widget.focused_item.get;
+      //TIZEN_ONLY(20150625): fix item resize issue.
+      Elm.Widget.orientation.set;
+      //
       Elm_Interface_Atspi_Widget_Action.elm_actions.get;
       Elm_Interface_Atspi_Accessible.children.get;
       Elm_Interface_Atspi_Accessible.state_set.get;