elm_panel: scrollable panel content size ratio refactoring (for 2.4 UX) 48/108648/4 accepted/tizen/common/20170110.154939 accepted/tizen/ivi/20170110.081011 accepted/tizen/mobile/20170110.080855 accepted/tizen/tv/20170110.080919 accepted/tizen/wearable/20170110.080945 submit/tizen/20170110.035404
authorJEONGHYUN YUN <jh0506.yun@samsung.com>
Thu, 5 Jan 2017 09:33:33 +0000 (18:33 +0900)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Mon, 9 Jan 2017 01:54:22 +0000 (17:54 -0800)
scrollable panel content size ratio refactoring (for 2.4 UX)

@tizen_fix

Change-Id: I19f3866cb269ed88a26052e0e6ae078755b49330
Signed-off-by: JEONGHYUN YUN <jh0506.yun@samsung.com>
src/lib/elm_panel.c
src/lib/elm_widget_panel.h

index 089b61bf3bc2e44090825c9dcfc7359332a19bec..f8fb3848c320f7395d9f990155abd0e731ef2544 100644 (file)
@@ -1045,6 +1045,12 @@ _elm_panel_evas_object_smart_add(Eo *obj, Elm_Panel_Data *priv)
    elm_widget_can_focus_set(obj, EINA_TRUE);
 
    priv->panel_edje = wd->resize_obj;
+   // TIZEN_ONLY(20170105): scrollable panel content size ratio refactoring (for 2.4 UX)
+   if ((elm_win_rotation_get(elm_widget_top_get(obj)) == 90) || (elm_win_rotation_get(elm_widget_top_get(obj)) == 270))
+     priv->content_size_ratio = 0.45;
+   else
+     priv->content_size_ratio = 0.80;
+   //
 
    eo_do(obj, elm_obj_widget_theme_apply());
 
@@ -1110,18 +1116,6 @@ _elm_panel_evas_object_smart_del(Eo *obj, Elm_Panel_Data *sd)
    eo_do_super(obj, MY_CLASS, evas_obj_smart_del());
 }
 
-// TIZEN_ONLY(20150128): Panel implementation merge into 2.4
-EOLIAN static void
-_elm_panel_elm_widget_orientation_set(Eo *obj, Elm_Panel_Data *sd EINA_UNUSED, int orient_mode)
-{
-   eo_do_super(obj, MY_CLASS, elm_obj_widget_orientation_set(orient_mode));
-   if (orient_mode == 90 || orient_mode == 270)
-     elm_panel_scrollable_content_size_set(obj, 0.45);
-   else
-     elm_panel_scrollable_content_size_set(obj, 0.80);
-}
-////////////////////////////////////////////////////////////
-
 EOLIAN static void
 _elm_panel_evas_object_smart_move(Eo *obj, Elm_Panel_Data *sd, Evas_Coord x, Evas_Coord y)
 {
@@ -1174,6 +1168,30 @@ _elm_panel_evas_object_smart_member_add(Eo *obj, Elm_Panel_Data *sd, Evas_Object
    if (sd->hit_rect) evas_object_raise(sd->hit_rect);
 }
 
+// TIZEN_ONLY(20170105): scrollable panel content size ratio refactoring (for 2.4 UX)
+EOLIAN static void
+_elm_panel_elm_widget_orientation_set(Eo *obj, Elm_Panel_Data *sd, int orient_mode)
+{
+   eo_do_super(obj, MY_CLASS, elm_obj_widget_orientation_set(orient_mode));
+
+   if (!sd->content_size_manual_set)
+     {
+        if (orient_mode == 90 || orient_mode == 270)
+          sd->content_size_ratio = 0.45;
+        else
+          sd->content_size_ratio = 0.80;
+     }
+
+   if (sd->scrollable)
+     {
+        Evas_Coord w, h;
+        evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+
+        _scrollable_layout_resize(obj, sd, w, h);
+     }
+}
+//
+
 EOLIAN static void
 _elm_panel_elm_widget_access(Eo *obj, Elm_Panel_Data *_pd, Eina_Bool is_access)
 {
@@ -1248,7 +1266,13 @@ _elm_panel_orient_set(Eo *obj, Elm_Panel_Data *sd, Elm_Panel_Orient orient)
              elm_layout_signal_emit(sd->scr_ly, "elm,state,content,hidden", "elm");
           }
 
-        elm_panel_scrollable_content_size_set(obj, sd->content_size_ratio);
+        // TIZEN_ONLY(20170105): scrollable panel content size ratio refactoring (for 2.4 UX)
+        //elm_panel_scrollable_content_size_set(obj, sd->content_size_ratio);
+        Evas_Coord w, h;
+        evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+
+        _scrollable_layout_resize(obj, sd, w, h);
+        //
      }
    else
      _orient_set_do(obj);
@@ -1431,6 +1455,9 @@ _elm_panel_scrollable_content_size_set(Eo *obj, Elm_Panel_Data *sd, double ratio
    else if (ratio > 1.0) ratio = 1.0;
 
    sd->content_size_ratio = ratio;
+   // TIZEN_ONLY(20170105): scrollable panel content size ratio refactoring (for 2.4 UX)
+   sd->content_size_manual_set = EINA_TRUE;
+   //
 
    if (sd->scrollable)
      {
@@ -1480,13 +1507,6 @@ _elm_panel_scrollable_set(Eo *obj, Elm_Panel_Data *sd, Eina_Bool scrollable)
 
         elm_widget_resize_object_set(obj, sd->scr_edje, EINA_TRUE);
 
-        // TIZEN_ONLY(20150128): Panel implementation merge into 2.4
-        if (elm_win_rotation_get(elm_widget_top_get(obj)) == 90 || elm_win_rotation_get(elm_widget_top_get(obj)) == 270)
-          elm_panel_scrollable_content_size_set(obj, 0.45);
-        else
-          elm_panel_scrollable_content_size_set(obj, 0.80);
-        ////////////////////////////////////////////////////////////
-
         if (!sd->hit_rect)
           {
              sd->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj));
@@ -1526,6 +1546,13 @@ _elm_panel_scrollable_set(Eo *obj, Elm_Panel_Data *sd, Eina_Bool scrollable)
         elm_layout_content_set(sd->scr_ly, "elm.swallow.content", sd->bx);
         if (sd->content) elm_widget_sub_object_add(sd->scr_ly, sd->content);
 
+        // TIZEN_ONLY(20170105): scrollable panel content size ratio refactoring (for 2.4 UX)
+        Evas_Coord w, h;
+        evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+
+        _scrollable_layout_resize(obj, sd, w, h);
+        //
+
         switch (sd->orient)
           {
            case ELM_PANEL_ORIENT_TOP:
index 6068d5a7ef314be239e532aaecba4dee91610197..35e6edca698fb18b6eaa2fb144bfa12251fa4361 100644 (file)
@@ -46,6 +46,9 @@ struct _Elm_Panel_Data
    Eina_Bool                             delete_me : 1;
    Eina_Bool                             scrollable : 1;
    Eina_Bool                             freeze: 1;
+   // TIZEN_ONLY(20170105): scrollable panel content size ratio refactoring (for 2.4 UX)
+   Eina_Bool                             content_size_manual_set: 1;
+   //
 };
 
 /**